public void open ( ) { if ( sqlSession == null ) { if ( executorType == null ) { executorType = ExecutorType . SIMPLE ; } sqlSession = sqlSessionFactory . openSession ( executorType , autoCommit ) ; if ( log . isDebugEnabled ( ) ) { ToStringBuilder tsb = new ToStringBuilder ( String . format ( "%s %s@%x" , ( arbitrarilyClosed ? "Reopened" : "Opened" ) , sqlSession . getClass ( ) . getSimpleName ( ) , sqlSession . hashCode ( ) ) ) ; tsb . append ( "executorType" , executorType ) ; tsb . append ( "autoCommit" , autoCommit ) ; log . debug ( tsb . toString ( ) ) ; } arbitrarilyClosed = false ; } }
Opens a new SqlSession and store its instance inside . Therefore whenever there is a request for a SqlSessionTxAdvice bean a new bean instance of the object must be created .