@Override public boolean isActive() { return transactions[0].isActive(); }
/** * Check if the given transaction object indicates an existing transaction * (that is, a transaction which has already started). * <p> * The result will be evaluated according to the specified propagation * behavior for the new transaction. An existing transaction might get * suspended (in case of PROPAGATION_REQUIRES_NEW), or the new transaction * might participate in the existing one (in case of PROPAGATION_REQUIRED). * <p> * The default implementation returns <code>false</code>, assuming that * participating in existing transactions is generally not supported. * Subclasses are of course encouraged to provide such support. * * @param transaction * transaction object returned by doGetTransaction * @return if there is an existing transaction * @throws TransactionException * in case of system errors * @see #doGetTransaction */ @Override protected boolean isExistingTransaction(Object transaction) { return ((TransactionObject) transaction).getTransaction() != null && ((TransactionObject) transaction).getTransaction().isActive(); }
inSession = true; Session session = sessionContext.getCurrentSession(); inTx = session.getTransaction() != null && session.getTransaction().isActive();
inSession = true; Session session = sessionContext.getCurrentSession(); inTx = session.getTransaction() != null && session.getTransaction().isActive();