226227228229230231232233234235236
if (tx.isActive()) { if (tx.getRollbackOnly()) { tx.rollback(); } else { tx.commit(); } } } catch (RuntimeException re) { if (tx.isActive()) { tx.rollback();
8182838485868788899091
try { worker.setup(workerId, session); setupSuccess = true; } finally { if (setupSuccess) { transaction.commit(); } else { transaction.rollback(); } session.close(); }
135136137138139140141142143144145
transaction.begin(); worker.run(result, session); result.setResponseCodeOK(); transaction.commit(); } catch (Exception e) { getLogger().error("Error during worker processing", e); result.setResponseCode("500"); transaction.rollback(); } finally {
3839404142434445464748
try { filterChain.doFilter(servletRequest, servletResponse); if (tx.isActive()) { if (tx.getRollbackOnly()) tx.rollback(); else tx.commit(); } } catch (IOException ex) { if (tx.isActive()) tx.rollback(); throw ex; } catch (ServletException ex) {
199200201202203204205206207208209
} public void stopSession(KeycloakSession session, boolean commit) { KeycloakTransaction transaction = session.getTransaction(); if (commit && !transaction.getRollbackOnly()) { transaction.commit(); } else { transaction.rollback(); } session.close(); }