Well when it comes to EntityManagers be sure to close, commit and clear your threadlocal instance after your service request cycle.
** Martin 2009/6/9 Adrian Merrall <[email protected]>: >> >> >> I try to keep my UI logic, my business logic, and my persistence >> strategy separate. Putting the EntityManager in the Request means you >> have to pass the Request around into your business logic layer. By >> putting it in a ThreadLocal, the UI and business layers can be >> blissfully unaware of its existance. >> >> BTW I use Spring's OpenEntityManagerInViewFilter for this. Works very >> well. >> > > If you are using a ThreadLocal it is worth reading this.. > > http://www.javaspecialists.eu/archive/Issue164.html > > as it covers issues of ThreadLocal and garbage collection. > > HTH > > Adrian > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
