@Override public void afterBegin() { try { // We need this as from Hibernate4 and with JTATransactionFactory, there is need to separately start IDM (Hibernate) // transaction as well even if JTA transaction is started if (!idmService.getIdentitySession().getTransaction().isActive()) { idmService.getIdentitySession().beginTransaction(); } } catch (Exception e) { throw new RuntimeException(e); } } }
public void startTransaction() throws Exception { if (!getIdentitySession().getTransaction().isActive()) { getIdentitySession().beginTransaction(); } }
/** * Used to allow nested requests (as done by the authenticator during unit tests) and avoid to commit two times the same * transaction. */ /* * * private ThreadLocal<AtomicInteger> currentRequestCount = new ThreadLocal<AtomicInteger>() { * * @Override protected AtomicInteger initialValue() { return new AtomicInteger(); } }; */ public void startRequest(ExoContainer container) { if (!acceptComponentRequestCall) return; try { if (configuration.isUseJTA()) { if (traceLoggingEnabled) { log.trace("Starting UserTransaction in method startRequest"); } jtaTransactionLifecycleService.beginJTATransaction(); } else { if (!idmService_.getIdentitySession().getTransaction().isActive()) { idmService_.getIdentitySession().beginTransaction(); } } } catch (Exception e) { log.error(e.getMessage(), e); } }