@Override public void init() { userTransactionService.init(); }
/** * Performs initialization and transaction recovery. This is done after transactional resources (potentially in other extensions) have registered with the * transaction manager. */ public void onEvent(RuntimeRecover event) { synchronized (TransactionManagerImp.class) { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); tm = (TransactionManagerImp) TransactionManagerImp.getTransactionManager(); if (tm == null) { uts = new UserTransactionServiceImp(properties); uts.init(properties); tm = (TransactionManagerImp) TransactionManagerImp.getTransactionManager(); } if (timeout != -1) { try { tm.setTransactionTimeout(timeout); } catch (SystemException e) { e.printStackTrace(); } } } finally { Thread.currentThread().setContextClassLoader(old); } } }
/** * Performs initialization and transaction recovery. This is done after transactional resources (potentially in other extensions) have registered with the * transaction manager. */ public void onEvent(RuntimeRecover event) { synchronized (TransactionManagerImp.class) { ClassLoader old = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(getClass().getClassLoader()); tm = (TransactionManagerImp) TransactionManagerImp.getTransactionManager(); if (tm == null) { uts = new UserTransactionServiceImp(properties); uts.init(properties); tm = (TransactionManagerImp) TransactionManagerImp.getTransactionManager(); } if (timeout != -1) { try { tm.setTransactionTimeout(timeout); } catch (SystemException e) { e.printStackTrace(); } } } finally { Thread.currentThread().setContextClassLoader(old); } } }
/** * Referenceable mechanism requires later setup of txmgr_, otherwise binding * into JNDI already requires that TM is running. */ private void checkSetup () { synchronized ( TransactionManagerImp.class ) { txmgr_ = TransactionManagerImp.getTransactionManager (); if ( txmgr_ == null ) { UserTransactionService uts = new UserTransactionServiceImp (); uts.init(); txmgr_ = TransactionManagerImp.getTransactionManager (); } } }