You can use a servlet filter for managing enitity managers (and 
transactions)


   1. in Filter.init() create the entity manager factory
   2. in Filter.destroy() close the factory.
   3. create an entity manager on demand (if it is needed) in your code, 
   place it into thread local so that others can refer to it in the same 
   request
   4. in Filter.doFilter() close the entity manager after calling 
   chain.doFilter(), but only if the entity manager was created in step 3
   


-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to