Adam, I'm interested in this as well, I'm trying to build a Struts2 app to be distributed that provides a "best-practices" example of JPA in struts2 (a refactoring of the struts-mailreader for those who are familiar with it). I want to keep Spring out, so I was thinking of adapting the OpenSessionInView interceptor that people use with Hibernate.
-Wes On 11/10/07, Adam Hardy <[EMAIL PROTECTED]> wrote: > 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 > configuration). > > 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. > > > Thanks > Adam > -- Wesley Wannemacher President, Head Engineer/Consultant WanTii, Inc. http://www.wantii.com
