Code example for Session

Methods: close

0
     */ 
    @Override 
    public void close() { 
        if (session != null) {
            try { 
                session.close();
            } finally { 
                session = null;
            } 
        } 
    } 
     
    /** 
     * Get a cursor over all of the results, with the forward-only flag set. 
     *  
     * @return a forward-only {@link ScrollableResults} 
     */ 
    private ScrollableResults getForwardOnlyCursor(Filter filter) {
        if (session == null) {
            session = sessionFactory.openSession();