users@glassfish.java.net

Creating a custom sequence generator for JTA/toplink

From: <glassfish_at_javadesktop.org>
Date: Tue, 25 Mar 2008 07:24:43 PST

Hi,

i would like to create my own sequencegenerator
instead of using "@GeneratedValue(strategy = GenerationType.AUTO)"

Can't use GenerationType.IDENTITY, because the id is not available at the
the _before_ call em.persist().

Can't use GenerationType.SEQUENCE, because mysql does not support it.

Can't use GenerationType.TABLE, because my concurrent called Sessionbean A
want's to create one entity in Table TabA, but the sessionbeans runs to long (about 30 second) - so, i build-in (toplink) primary-key generator throws a TimeoutException...

Question: Is there a sample code for performant sequence generator ?

regards

Danny
[Message sent by forum member 'danny70437' (danny70437)]

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