users@glassfish.java.net

EJB2 with identity / auto-generated primary key

From: <glassfish_at_javadesktop.org>
Date: Thu, 14 May 2009 06:13:04 PDT

I have an EJB2 bean with an identity column (the value is automatically generated by the database, JavaDB in this case), but I can't work out how to make GF "play nice" with this bean/column. I would expect to do it in either sub-ejb-jar.xml or sun-cmp-mappings.xml but neither seems to have the appropriate tags. I haven't listed any error message because ...

Some googling leads me to believe that GF (2.1) can't handle this, but I'm hoping I'm wrong.

I [b]know[/b] that GF handles this just fine for an EJB3 bean because I've done it - unfortunately I have to back port to EJB2 - which is why I'd be surprised if GF can't handle for an EJB2 bean (though I guess the code for the two must be quite separate). I also know that JBoss 4.2.3 handles it because I got that working after much googling.

TIA, m.
[Message sent by forum member 'matterbury' (matterbury)]

http://forums.java.net/jive/thread.jspa?messageID=346260