public static SqlSessionFactory getSessionFactory() throws IOException {
		SqlSessionFactory sessionFactory = THREAD_SESSION_FACTORY.get();
		try {
			if (sessionFactory == null) {
				sessionFactory = new DefaultSqlSessionFactory();
				THREAD_SESSION_FACTORY.set(sessionFactory);
			}
		} catch (Exception e) {  
	        throw new IOException(e);  
	    }  
	    return sessionFactory;  
	}
public static SqlSessionFactory getSessionFactory ( ) throws IOException { SqlSessionFactory sessionFactory = THREAD_SESSION_FACTORY . get ( ) ; try { if ( sessionFactory == null ) { sessionFactory = new DefaultSqlSessionFactory ( ) ; THREAD_SESSION_FACTORY . set ( sessionFactory ) ; } } catch ( Exception e ) { throw new IOException ( e ) ; } return sessionFactory ; }
获取当前线程的会话工厂类

@return 会话工厂类
@throws IOException IO异常处理