You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the JpaPersistService.end() method as copied from the source code:
public void end() {
EntityManager em = entityManager.get();
// Let's not penalize users for calling end() multiple times.
if (null == em) {
return;
}
em.close();
entityManager.remove();
}
The call to em.close() could fail sometimes. In my particular case it failed because I tried to save an object with byte[] field having more then 500 bytes. This coused the last line to be skipped. Effectively this thread could no longer be used to serve requests because the begin() method of JpaPersistService would always fail.
The fix is to simply surround the em.close() invocation with try-finally block
From hristo.sabev on March 20, 2012 13:53:45
This is the JpaPersistService.end() method as copied from the source code:
public void end() {
EntityManager em = entityManager.get();
// Let's not penalize users for calling end() multiple times.
if (null == em) {
return;
}
em.close();
entityManager.remove();
}
The call to em.close() could fail sometimes. In my particular case it failed because I tried to save an object with byte[] field having more then 500 bytes. This coused the last line to be skipped. Effectively this thread could no longer be used to serve requests because the begin() method of JpaPersistService would always fail.
The fix is to simply surround the em.close() invocation with try-finally block
Original issue: http://code.google.com/p/google-guice/issues/detail?id=694
The text was updated successfully, but these errors were encountered: