users@glassfish.java.net

Re: Cannot have a jpa persistent object query inside a static init block

From: <glassfish_at_javadesktop.org>
Date: Mon, 14 Jan 2008 18:11:46 PST

Thanks for replying.

I understand that static blocks are executed by the class loader when it loads the class. I am currently ambivalent as to when table generation occurs. I only mentioned it to show that I found the solution to my problem almost by accident and to emphasise the difficulty I had finding the solution. (Would anyone here have been able to solve my problem if I had have only shown the first stack trace?) I can accept that persistence providers need to perform some sort of initialisation. What I’m asking is:

Did anyone know the ramifications of how Toplink does their entity manager initialisation? If so where is it documented?

Can the Toplink entity manager initialisation be coded so that entity queries can be made from static init blocks? If not will Toplink provide better error reporting when this situation occurs?
[Message sent by forum member 'dannycron' (dannycron)]

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