base/common/src/main/com/thesett/common/tx/GlobalWriteLockWithWriteBehindTxMethod.java
private void enlistWithSession()
    {
        TxSession session = TxSessionImpl.getCurrentSession();

        // Ensure that this resource is being used within a session.
        if (session == null)
        {
            throw new IllegalStateException("Cannot access transactional resource outside of a session.");
        }

        // Ensure that this resource is enlisted with the session.
        session.enlist(this);
    }
private void enlistWithSession()
    {
        TxSession session = TxSessionImpl.getCurrentSession();

        // Ensure that this resource is being used within a session.
        if (session == null)
        {
            throw new IllegalStateException("Cannot access transactional resource outside of a session.");
        }

        // Ensure that this resource is enlisted with the session.
        session.enlist(this);
    }
Enlists this transactional resource with the current session. If no session exists this will fail.

@throws IllegalStateException If this resource is transactional and accessed outside of a transaction.