users@glassfish.java.net

Re: Surprising JPA (Toplink) Behaviour (glassfish v1 UR1)

From: <glassfish_at_javadesktop.org>
Date: Mon, 19 Mar 2007 12:05:27 PST

[i]As long as you are not expecting any active Entity Manager to be updated with changes from another Entity Manager then you should not have stale data issues when using only a single EMF (or EMFs from the same PU). [/i]

This first version of my system calls emf.createEntityManager for each interaction
with the database, and calls em.close() in the finally block. I only have one PU.

[i]Unless your issues are with updates outside of JPA?[/i]

There is no other process that touches the database, nor is there any plain JDBC code
in the same application that touches the database. Everything that interacts with the
database is JPA code within the same WAR.

[i]EMFs in TopLink Essentials are not heavy weight objects. They are backed by a shared heavy weight object called a ServerSession.[/i]

Well, at least I can stop obsessing about having a singleton EMF. Thank you.
[Message sent by forum member 'pohl' (pohl)]

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