how to generate pk increasement for cmp
Hi,
If the pk is auto-increase by 2, how can I write the ceate() in entity-bean?
I can write a pk_generator, but if server restarts, then the key is going to reset from 1 again.
Also, how the client call this create(), if I don't want the client specify the number of pk?
--
Thanks lots
John
Toronto
Hi John,Can you give a little bit more details? Which code auto-increments PKs by 2?Why do you need it that way? What are you trying to accomplish?Thank you,-marina
>I can write a pk_generator, but if server restarts, then the key is going to reset from 1 again.
One approach is to persist the value generated by pk_generator so you can read it back when server restarts.
You can also use "Automatic Primary Key Generation". That will generate the pk value for you. Please see the developer's guide for more information. http://docs.sun.com/app/docs/doc/819-4721/6n6rrfql4?a=view#beajq