org.activemath.util.db
Class MybatisHelper

java.lang.Object
  extended by org.activemath.util.db.MybatisHelper

public class MybatisHelper
extends Object


Field Summary
protected static Logger log
           
 
Method Summary
 org.apache.ibatis.session.SqlSession getAMCoreSession()
          Opens a new MyBatis session connected to the database backend for the core Activemath application and returns it.
static MybatisHelper getInstance()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static Logger log
Method Detail

getInstance

public static MybatisHelper getInstance()

getAMCoreSession

public org.apache.ibatis.session.SqlSession getAMCoreSession()
Opens a new MyBatis session connected to the database backend for the core Activemath application and returns it.

The session returned *is* thread-safe, as it is handled as a managed session by SqlSessionManager. However, it is vital to close() this session when you're done (using a finally branch).

Returns:
A freshly opened Mybatis session that is thread-safe, managed internally by a ThreadLocal.