openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Hardy <>
Subject setting up transactions
Date Sat, 10 Nov 2007 15:09:49 GMT
I need transactions in my webapp using the OpenSessionInView filter pattern to 
enable use of entities in my JSPs.

I am not using an EJB3 container, and I am restricting my use of Spring, or at 
least trying to, to the IoC and transaction manager (for XML transaction 

Is there a recognised JPA mechanism or pattern or an open-source framework for 
non-EJB container transactions for this:

(1) servlet filter starts an EntityManager for a thread
(2) stores it in a ThreadLocal
(3) passes it to the transaction manager (Spring at the moment)
(4) lets JSPs run
(5) commits or gets Spring tx manager to commit / rollback etc

I am currently stripping down Spring-web's OpenEntityManagerInViewFilter but if 
there is another lightweight transaction framework out there which fits well 
with JPA, it'd be preferable.


View raw message