rsanchez
2015-01-29 43a39932002da177c7029452a666edc0c00e541a
securis/src/main/java/net/curisit/securis/DefaultExceptionHandler.java
....@@ -58,18 +58,18 @@
5858 }
5959
6060 private void releaseEntityManager() {
61
- if (em != null && em.isOpen()) {
62
- LOG.debug("CLOSING EM: {}, trans: {}", em, em.isJoinedToTransaction());
63
- try {
61
+ try {
62
+ if (em != null && em.isOpen()) {
63
+ LOG.debug("CLOSING EM: {}, trans: {}", em, em.isJoinedToTransaction());
6464 if (em.isJoinedToTransaction()) {
6565 em.getTransaction().rollback();
6666 LOG.info("ROLLBACK");
6767 }
6868 em.close();
69
- } catch (Exception ex) {
70
- ex.printStackTrace();
71
- LOG.error("Error closing EM: {}, {}", em, ex);
7269 }
70
+ } catch (Exception ex) {
71
+ ex.printStackTrace();
72
+ LOG.error("Error closing EM: {}, {}", em, ex);
7373 }
7474 }
7575 }