users@glassfish.java.net

Re: Keeping managed entities up to date when using the ACC.

From: <glassfish_at_javadesktop.org>
Date: Thu, 06 Sep 2007 18:06:33 PDT

Ryan,

Is it a typo or you are indeed injecting an EntityManager, not the factory? And one more question - what does each client close at the end of accessing an entity?

If you inject the factory, then create a new EM instance for each access, and close it at the end, the entity state will be fetched from the EMF cache, whatever is the latest version there available. em.refresh() will go to the database, which won't be necessary, unless there is another PU or application that modifies the same data.

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

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