users@glassfish.java.net

Re: Is there a way to represent an Entity as Singleton?

From: <glassfish_at_javadesktop.org>
Date: Thu, 04 Oct 2007 15:28:54 PDT

Detach it and pass it around or store in a static variable of a helper class?

The problem is that EMs by spec definition are not thread safe, so an option to have a special EM0 that carries only those singletons in its persistence context can be unreliable. And each separate EM (i.e. separate persistence context) will have its own copy according to the spec.

Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]

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