persistence@glassfish.java.net

Re: Entity manager in web applications

From: Marina Vatkina <Marina.Vatkina_at_Sun.COM>
Date: Sat, 02 Sep 2006 13:38:06 -0700

Hi Uwe,

This information will be helpful:
https://blueprints.dev.java.net/bpcatalog/ee5/persistence/webonlyapp.html

regards,
-marina

Uwe Gerger wrote:
> Hi,
> I'm confused about using an entity manager in a web application. I would like to use container managed persitence. Now my questions:
>
> 1) can I inject an entity manager factory in a multithreaded servlet?
>
> 2) can I use only one and the same entity manager in the context of one transaction or is it possible to use different entity managers within one transaction by injecting the entity manager factory in the different objects?
>
> Thanks in advanced
> Uwe