/** * Create a new instance. */ public ServerVMClientUserTransaction() { this(TransactionManagerLocator.locateTransactionManager(false), false); }
/** * Create a new instance. */ private ServerVMClientUserTransaction() { this(TransactionManagerLocator.locateTransactionManager(false)); }
public TransactionManager getTransactionManager() { if (tm == null) tm = TransactionManagerLocator.locateTransactionManager(); return tm; }
public TransactionManager getTransactionManager() { return TransactionManagerLocator.locateTransactionManager(); } }
public TransactionManager getTm() { return TransactionManagerLocator.locateTransactionManager(); } }
/** * Creates a thread local variable. * @throws IllegalStateException if there is no system transaction manager */ public TransactionLocal() { transactionManager = TransactionManagerLocator.locateTransactionManager(); initDelegate(); }
/** * Creates a thread local variable. * @throws IllegalStateException if there is no system transaction manager */ public TransactionLocal() { transactionManager = TransactionManagerLocator.locateTransactionManager(); initDelegate(); }
/** * * @return an interface for registering interest in transaction lifecycle events * @throws TransactionListenerRegistryUnavailableException if no such interface has been registered with the SPI */ public static TransactionListenerRegistry getTransactionListenerRegistry() throws TransactionListenerRegistryUnavailableException { TransactionManager tm = TransactionManagerLocator.locateTransactionManager(); if (tm instanceof TransactionListenerRegistry) { return (TransactionListenerRegistry) tm; } throw new TransactionListenerRegistryUnavailableException(); } }
/** * Suspend any transaction associated with the thread * * @return any suspended transaction or null if there was no transaction */ public static Transaction suspendAnyTransaction() { TransactionManager tm = TransactionManagerLocator.locateTransactionManager(); try { return tm.suspend(); } catch (SystemException e) { throw new RuntimeException("Unable to suspend transaction", e); } }
/** * Suspend any transaction associated with the thread * * @return any suspended transaction or null if there was no transaction */ public static Transaction suspendAnyTransaction() { TransactionManager tm = TransactionManagerLocator.locateTransactionManager(); try { return tm.suspend(); } catch (SystemException e) { throw new RuntimeException("Unable to suspend transaction", e); } }
/** * Resume any transaction * * @param tx the transaction to resume */ public static void resumeAnyTransaction(Transaction tx) { // Nothing to do if (tx == null) return; TransactionManager tm = TransactionManagerLocator.locateTransactionManager(); try { tm.resume(tx); } catch (InvalidTransactionException e) { throw new RuntimeException("Unable to resume an invalid transaction", e); } catch (SystemException e) { throw new RuntimeException("Unable to suspend transaction", e); } } }
/** * Resume any transaction * * @param tx the transaction to resume */ public static void resumeAnyTransaction(Transaction tx) { // Nothing to do if (tx == null) return; TransactionManager tm = TransactionManagerLocator.locateTransactionManager(); try { tm.resume(tx); } catch (InvalidTransactionException e) { throw new RuntimeException("Unable to resume an invalid transaction", e); } catch (SystemException e) { throw new RuntimeException("Unable to suspend transaction", e); } } }
public static boolean isCompleted(UserTransaction ut) { try { int status = ut.getStatus(); return isCompleted(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isUncommitted(UserTransaction ut) { try { int status = ut.getStatus(); return isUncommitted(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isActive(UserTransaction ut) { try { int status = ut.getStatus(); return isActive(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isActive(UserTransaction ut) { try { int status = ut.getStatus(); return isActive(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isRollback(UserTransaction ut) { try { int status = ut.getStatus(); return isRollback(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isUncommitted(UserTransaction ut) { try { int status = ut.getStatus(); return isUncommitted(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isCompleted(UserTransaction ut) { try { int status = ut.getStatus(); return isCompleted(status); } catch (SystemException error) { throw new RuntimeException(error); } }
public static boolean isRollback(UserTransaction ut) { try { int status = ut.getStatus(); return isRollback(status); } catch (SystemException error) { throw new RuntimeException(error); } }