Thanks for the input. I am not operating inside an explicit EJB
context or application server, but rather using OpenJPA in a regular
J2SE application as a persistence layer.

In other words, I manage the scope of my own transactions and my
entityManager lifecycles.

My transactions I understand how to scope. How should I scope the EntityManager?

-Marc

On 11/5/07, Oliver Zeigermann <[EMAIL PROTECTED]> wrote:
> AFAIK in an EJB context the EM is closed when a transaction is ended.
> Unless you configure an extended persistence context. In that case the
> EM stays open even when a transaction is commited and will be closed
> upon removal of the EJB that holds it.
>
> Oliver
>
> 2007/11/5, Marc Siegel <[EMAIL PROTECTED]>:
> > Hi Folks,
> >
> > Is it necessary to close the EntityManager and open a new one to avoid
> > memory leaks / excessive usage? What is the best practice for
> > EntityManager lifecycle?
> >
> > -Marc
> >
>

Reply via email to