Comment #3 on issue 595 by [email protected]: PersistModule doesn't bind interceptor for class-level @Transactional annotation
http://code.google.com/p/google-guice/issues/detail?id=595

About #2 above: On second thought, is the point to allow users to choose to not manually start a UnitOfWork and have it only start when (and if) it's needed? And then to have them call end() at some point in case one was started? I can see the advantage in that, but I still somewhat worry that it makes it too easy to leave an unclosed EntityManager in the ThreadLocal. I also think in many cases, the EntityManager would likely be retrieved even if it weren't used, either due to a high level @Transactional method or due to a class that has the EntityManager injected into it being instantiated.

I think my preference would be to require that either a UnitOfWork be manually started before a class that has an EntityManager injected into it is instantiated (already the case for any webapp using PersistFilter) or that a Provider<EntityManager> be injected and called in each transactional method when a UnitOfWork is guaranteed to be active.

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" 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-guice-dev?hl=en.

Reply via email to