You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by Georgi Naplatanov <go...@oles.biz> on 2008/03/27 08:40:10 UTC
Setting Extended Persistence Context
Hello, everybody.
How I can change context to "Extended Persistence Context" outside a EJB
container ?
The example 3.1 of OpenJPA documentation don't compile due the error
"em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;
The method createEntityManager(Map) in the type EntityManagerFactory is
not applicable for the arguments (PersistenceContextType)"
Best regards
Georgi
Re: Setting Extended Persistence Context
Posted by Georgi Naplatanov <go...@oles.biz>.
Hello, Michael,
You are right, it's my fault, but I want to switch persistence context
(Transaction/Extended) for some tests and have not luck with the example
from OpenJPA documentation.
Best regards
Georgi
Michael Dick wrote:
> Hi Georgi,
>
> By default all application managed EntityManagers are extended, so you
> shouldn't have to do anything.
>
> Are you seeing different behavior with OpenJPA?
>
> -Mike
>
> On Thu, Mar 27, 2008 at 2:40 AM, Georgi Naplatanov <go...@oles.biz> wrote:
>
>> Hello, everybody.
>>
>> How I can change context to "Extended Persistence Context" outside a EJB
>> container ?
>>
>> The example 3.1 of OpenJPA documentation don't compile due the error
>>
>> "em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;
>>
>> The method createEntityManager(Map) in the type EntityManagerFactory is
>> not applicable for the arguments (PersistenceContextType)"
>>
>> Best regards
>> Georgi
>>
>
Re: Setting Extended Persistence Context
Posted by Michael Dick <mi...@gmail.com>.
Hi Georgi,
By default all application managed EntityManagers are extended, so you
shouldn't have to do anything.
Are you seeing different behavior with OpenJPA?
-Mike
On Thu, Mar 27, 2008 at 2:40 AM, Georgi Naplatanov <go...@oles.biz> wrote:
> Hello, everybody.
>
> How I can change context to "Extended Persistence Context" outside a EJB
> container ?
>
> The example 3.1 of OpenJPA documentation don't compile due the error
>
> "em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;
>
> The method createEntityManager(Map) in the type EntityManagerFactory is
> not applicable for the arguments (PersistenceContextType)"
>
> Best regards
> Georgi
>
Re: Setting Extended Persistence Context
Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Georgi,
Oops, don't know where that came from. It's a bug in the example code.
Outside the container environment, all you can use is extended
persistence context, so there's no use for the flag.
Could you please file a JIRA so we notify you once it's been fixed?
Thanks.
Craig
On Mar 27, 2008, at 12:40 AM, Georgi Naplatanov wrote:
> Hello, everybody.
>
> How I can change context to "Extended Persistence Context" outside a
> EJB
> container ?
>
> The example 3.1 of OpenJPA documentation don't compile due the error
>
> "em = factory.createEntityManager(PersistenceContextType.EXTENDED) ;
>
> The method createEntityManager(Map) in the type EntityManagerFactory
> is
> not applicable for the arguments (PersistenceContextType)"
>
> Best regards
> Georgi
Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!