protected boolean isWithinExistingTransaction(InternalCompassSession session) throws CompassException { return ((SessionImplementor) sessionFactory.getCurrentSession()).isTransactionInProgress(); }
public CompassSession getTransactionBoundSession() throws CompassException { Session session = sessionFactory.getCurrentSession(); if (!((SessionImplementor) session).isTransactionInProgress()) { return null; } return currentSessionMap.get(session.getTransaction()); }
public boolean isTransactionInProgress() { return ( (SessionImplementor) getRawSession() ).isTransactionInProgress(); }
public void lock(Object entity, LockModeType lockMode) { try { if ( ! isTransactionInProgress() ) { throw new TransactionRequiredException( "no transaction is in progress" ); } //adjustFlushMode(); if ( !contains( entity ) ) throw new IllegalArgumentException( "entity not in the persistence context" ); getSession().lock( entity, getLockMode( lockMode ) ); } catch (HibernateException he) { throwPersistenceException( he ); } }
controllingNewTransaction = true; SessionImplementor hibernateSession = ((SessionImplementor) sessionFactory.getCurrentSession()); newTransaction = !hibernateSession.isTransactionInProgress(); transaction = sessionFactory.getCurrentSession().getTransaction(); if (newTransaction) {