I was just wondering if there is anything special that needs to be done in handling this situation... On this table, the database auto-increments and assigns a value to the primary key field on create... Will the cmp ejb just return this value on a create call, or is there anything special that needs to be done to handle this situation properly?
Thanks
Nic
Discussions
EJB programming & troubleshooting: Handling auto-incrementing field as primary key in cmp ejb
-
Handling auto-incrementing field as primary key in cmp ejb (2 messages)
- Posted by: Nic Holbrook
- Posted on: November 21 2001 10:36 EST
Threaded Messages (2)
- Handling auto-incrementing field as primary key in cmp ejb by Frank Weberskirch on November 26 2001 17:29 EST
- Handling auto-incrementing field as primary key in cmp ejb by Rick Jones on December 07 2001 11:00 EST
-
Handling auto-incrementing field as primary key in cmp ejb[ Go to top ]
- Posted by: Frank Weberskirch
- Posted on: November 26 2001 17:29 EST
- in response to Nic Holbrook
Forget the combination of autocounter fields and CMP. It does not work and there has a lot written of lines been written here about the generation of primary keys for CMP beans. -
Handling auto-incrementing field as primary key in cmp ejb[ Go to top ]
- Posted by: Rick Jones
- Posted on: December 07 2001 11:00 EST
- in response to Nic Holbrook
Nic,
We are trying to do the same thing. It seems that auto-generated primary keys are not officially supported with EJB 2.0 CMP, but several vendors do support it. You might want to check out the following:
http://www.mail-archive.com/ejbinterest at java dot sun dot com/msg19000.html
http://edocs.bea.com/wls/docs61/ejb/cmp.html#1066165
Good luck!
Rick