I set the value to 0 in the create method and somehow MySQL makes the value the proper value uder the autoincrement.  Seems to work, but makes me a little nervou.
 
Ivan
----- Original Message -----
Sent: Monday, May 21, 2001 9:19 AM
Subject: [JBoss-user] mySQL auto increment and CMP entity beans

I am using jboss 2.2.1 to create a simple CMP entity bean that has two properties, id and name. In the database the id is an auto increment column. In the bean managed version of this bean I had a second sql (select ns.section_id from nh_section ns where ns.section_id is null) call to get the id of the row just added. In the CMP version I am not setting the id so on return from the ejbCreate method the container gives an exception saying the id cannot be null. Is there a way in container managed persistance beans to get jaws to find out the id of the inserted row and set the id property to this value.
 
Thanks,
Paul
 
Paul Austin
Viant
Tel: +44-20-7984-7158
Fax: +44-20-7984-7101
AIM: PaustinViant
YahooIM: p_d_austin
JabberIM: paustin
 
 

Reply via email to