openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nino Saturnino Martinez Vazquez Wael <nino.marti...@jayway.dk>
Subject Re: JPA and persistence context
Date Fri, 04 Apr 2008 11:19:55 GMT
Okay thanks, sounds a little like youre at the stage im at too. I'll 
upgrade my spring then...

Adam Hardy wrote:
> I do not use OpenJPA in deployment, because there are some 
> show-stopper issues with it. But I do use it in testing and I'll use 
> it in the future for live sites when the issues are sorted.
>
> I use the extended persistence context though. In this case if you 
> don't manage the transactions yourself, then JPA won't use 
> transactions. But if you close the EntityManager, the entities will 
> become detached.
>
> I use Spring but the way I do it is solely with the Spring transaction 
> manager, I don't use any of the other Spring helper base classes or 
> interfaces, so this probably won't help you. You're bound to find the 
> 'best practice' from the Spring PoV on the springframeworks.org website.
>
> Pay attention to the version number though, I'm not sure Spring v2.0.1 
> is late enough.
>
> HTH
> Adam
>
> Nino Saturnino Martinez Vazquez Wael on 03/04/08 12:27, wrote:
>> So I guess no one uses OpenJPA in web applications?
>>
>> Only thing I wanted were some snipplets showing how you did 
>> transactions etc in a web application.
>>
>>
>> regards Nino
>>
>> Nino Saturnino Martinez Vazquez Wael wrote:
>>> Hi
>>>
>>> I wonder what best practices are on persistence context when running 
>>> in a web application(Apache Wicket). Currently my ap are using 
>>> extended, since it's the only way it works. But I found out why..
>>>
>>> When I switch to transaction based after I do changes i need to do 
>>> tx.begin tx.commit.
>>>
>>> So if I run via extended my pojo's never gets detached and tx's are 
>>> never used?
>>>
>>> And if I use transaction based I need to run a transaction every 
>>> time I wish to update?
>>>
>>> I'd like to hear your input and how you do it in your web application?
>>>
>>> BTW I use spring(2.0.1) to manage my entitymanager etc (I have 
>>> annotated my daoclass with @transactional)
>
>

-- 
-Wicket for love

Nino Martinez Wael
Java Specialist @ Jayway DK
http://www.jayway.dk
+45 2936 7684


Mime
View raw message