returns the threadlocal session instance . lazy initialize the sessionfactory if needed . concode_field_sep Configuration configuration concode_elem_sep String configFile concode_elem_sep ThreadLocal<Session> threadLocal concode_elem_sep String CONFIG_FILE_LOCATION concode_elem_sep org.hibernate.SessionFactory sessionFactory concode_field_sep Configuration getConfiguration concode_elem_sep void rebuildSessionFactory concode_elem_sep void closeSession concode_elem_sep void setConfigFile concode_elem_sep org.hibernate.SessionFactory getSessionFactory
Session function ( ) { Session loc0 = ( Session ) threadLocal . get ( ) ; if ( loc0 == null || ! loc0 . isOpen ( ) ) { if ( sessionFactory == null ) { rebuildSessionFactory ( ) ; } loc0 = ( sessionFactory != null ) ? sessionFactory . openSession ( ) : null ; threadLocal . set ( loc0 ) ; } return loc0 ; }