title: Guice-Persist - "Work already begun on this thread. Looks like you have called UnitOfWork.begin() twice without a balancing call to end() in between."
body: <p>Our application is a Java-GWT application that uses Guice-Persist and Guice-Servlet extensively.  We have never had a problem using the session-per-HTTPRequest feature of Guice-Persist which is similar to what Warp-persist originally used.</p>
  
  <p>We are filtering our webapp through the PersistFilter class as per the documentation.  Our persistence.xml file has transaction-type="RESOURCE_LOCAL" as per the Guice documentation <a href="http://code.google.com/p/google-guice/wiki/JPA" rel="nofollow noreferrer">here</a>.</p>
  
  <p>Now for some strange reason our PROD environment is showing the error </p>
  
  <p>"Work already begun on this thread. Looks like you have called UnitOfWork.begin() twice without a balancing call to end() in between."</p>
  
  <p><img src="https://i.stack.imgur.com/PsZUz.png" alt="enter image description here"></p>
  
  <p>It looks like there is an issue where nested Units of work are not supported in Guice-Persist. <a href="http://code.google.com/p/google-guice/issues/detail?id=597" rel="nofollow noreferrer">LINK</a> </p>
  
  <p>We also recently moved from hibernate 3.6.3.Final to 4.1.4.Final.  Not sure if his would have some sort of incompatibility with guice...</p>
  
  <p>At this point we are totally in the dark as to why this would be happening.</p>