private void finish() {
        try {
            if (session != null) {
                session.close();
            }
        } finally {
            ManagedSessionContext.unbind(SESSION_FACTORY);
            if (!SESSIONS.get().isEmpty()) {
                ManagedSessionContext.bind(SESSIONS.get().pop());
            }
        }
    }
private void finish ( ) { try { if ( session != null ) { session . close ( ) ; } } finally { ManagedSessionContext . unbind ( SESSION_FACTORY ) ; if ( ! SESSIONS . get ( ) . isEmpty ( ) ) { ManagedSessionContext . bind ( SESSIONS . get ( ) . pop ( ) ) ; } } }
Closes and unbinds the current session. <br/>
If {@link ManagedSessionContext} had a session before the current session, re-binds it to {@link ManagedSessionContext}