users@glassfish.java.net

Re: LazyLoad: EntityListeners and EntityManagers

From: <glassfish_at_javadesktop.org>
Date: Thu, 27 Sep 2007 07:54:41 PDT

The JPA specification does not allow access to the Persistence Provider from within a Listener. That is why you are not getting the EntityManager injected. You could acquire an application managed Entity Manager from TopLink in the Listener but this is vendor specific.

I would recommend making the currentPrice retrieval part of your application instead of part of your entity's state.
--Gordon
[Message sent by forum member 'gyorke' (gyorke)]

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