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 .