1
0
mirror of https://github.com/sismics/docs.git synced 2025-12-13 01:36:18 +00:00

PDF handling, file upload progression

This commit is contained in:
jendib
2013-07-28 18:29:03 +02:00
parent 19000d095f
commit 471933ca8c
14 changed files with 186 additions and 105 deletions

View File

@@ -105,21 +105,24 @@ public class RequestContextFilter implements Filter {
} catch (Exception e) {
ThreadLocalContext.cleanup();
log.error("An exception occured, rolling back current transaction", e);
// IOException are thrown if the client closes the connection before completion
if (!(e instanceof IOException)) {
log.error("An exception occured, rolling back current transaction", e);
// If an unprocessed error comes up from the application layers (Jersey...), rollback the transaction (should not happen)
if (em.isOpen()) {
if (em.getTransaction() != null && em.getTransaction().isActive()) {
em.getTransaction().rollback();
}
try {
em.close();
} catch (Exception ce) {
log.error("Error closing entity manager", ce);
// If an unprocessed error comes up from the application layers (Jersey...), rollback the transaction (should not happen)
if (em.isOpen()) {
if (em.getTransaction() != null && em.getTransaction().isActive()) {
em.getTransaction().rollback();
}
try {
em.close();
} catch (Exception ce) {
log.error("Error closing entity manager", ce);
}
}
throw new ServletException(e);
}
throw new ServletException(e);
}
ThreadLocalContext.cleanup();