public final class SqlSessionHolder
extends org.springframework.transaction.support.ResourceHolderSupport
SqlSession in TransactionSynchronizationManager.
The SqlSessionFactory that created that SqlSession is used as a key.
ExecutorType is also kept to be able to check if the user is trying to change it
during a TX (that is not allowed) and throw a Exception in that case.| Constructor and Description |
|---|
SqlSessionHolder(org.apache.ibatis.session.SqlSession sqlSession,
org.apache.ibatis.session.ExecutorType executorType,
org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator)
Creates a new holder instance.
|
| Modifier and Type | Method and Description |
|---|---|
org.apache.ibatis.session.ExecutorType |
getExecutorType() |
org.springframework.dao.support.PersistenceExceptionTranslator |
getPersistenceExceptionTranslator() |
org.apache.ibatis.session.SqlSession |
getSqlSession() |
clear, getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, resetRollbackOnly, setRollbackOnly, setSynchronizedWithTransaction, setTimeoutInMillis, setTimeoutInSeconds, unboundpublic SqlSessionHolder(org.apache.ibatis.session.SqlSession sqlSession,
org.apache.ibatis.session.ExecutorType executorType,
org.springframework.dao.support.PersistenceExceptionTranslator exceptionTranslator)
sqlSession - the SqlSession has to be hold.executorType - the ExecutorType has to be hold.exceptionTranslator - the PersistenceExceptionTranslator has to be hold.public org.apache.ibatis.session.SqlSession getSqlSession()
public org.apache.ibatis.session.ExecutorType getExecutorType()
public org.springframework.dao.support.PersistenceExceptionTranslator getPersistenceExceptionTranslator()
Copyright © 2010–2019 MyBatis.org. All rights reserved.