Comment #7 on issue 597 by [email protected]: Persist Extension: UnitOfWork.begin() throws IllegalStateException when called multiple times
http://code.google.com/p/google-guice/issues/detail?id=597

I had the same issue in an application on Tomcat.
I've read this article which helped me to figure out what the problem was:
http://barinskis.me/blog/2013/04/30/persistence-unit-of-work-pattern-in-sitebricks/

In my personal case, i had a request thread in Tomcat which was using a connexion for a very long time (a timeout setting was not configured properly in a client stub ...). During this period, Tomcat DBCP had closed and removed the connexion from pool considering it as abandoned (this is a dbcp common setting). So the associated unit of work was not properly ended. Therefore, a next request which was reusing the same thread from tomcat pool were doing unitofwork.begin() although an entitymanager were already attached to thread (see JpaPersistService class, its entityManager instance is a thread-local variable)

Hope this help.

I think we could handle that by adding a test in PersistFilter or JpaPersistService to manage this situation.



--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to