Class GlueLazyDataSourceTransactionManager
java.lang.Object
org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.jdbc.datasource.DataSourceTransactionManager
com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager
com.poscoict.glueframework.transaction.GlueLazyDataSourceTransactionManager
- All Implemented Interfaces:
GlueLazyTransactionManager
,GlueTransactionManager
,Serializable
,InitializingBean
,ConfigurableTransactionManager
,PlatformTransactionManager
,ResourceTransactionManager
,TransactionManager
public class GlueLazyDataSourceTransactionManager
extends GlueDataSourceTransactionManager
implements GlueLazyTransactionManager
GlueLazyTransactionManager 구현체. 내부적으로 Spring Framework에서 제공하는 DataSourceTransactionManager를 상속받는다. GlueLazyDataSourceTransactionManager는
GlueLazyJdbcDao와 같이 사용된다.
Bean Property
- dataSource : (필수)
- transactionDefinition : (선택)
예제
사용 예# 1
<bean id="tx" class="com.poscoict.glueframework.transaction.GlueLazyDataSourceTransactionManager">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="dao" class="com.poscoict.glueframework.dao.jdbc.GlueLazyJdbcDao">
<property name="dataSource" ref="dataSource"/>
<property name="queryManager" ref="queryManager"/>
<property name="fetchSize" value="100"/>
<property name="countQuery" value="select count(*) from (${query})"/>
</bean>
<bean id="dataSource" class="...">
</bean>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
AbstractPlatformTransactionManager.SuspendedResourcesHolder
-
Field Summary
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager
afterPropertiesSet, setTransactionDefinition
Methods inherited from class org.springframework.jdbc.datasource.DataSourceTransactionManager
doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getDataSource, getResourceFactory, isEnforceReadOnly, isExistingTransaction, obtainDataSource, prepareTransactionalConnection, setDataSource, setEnforceReadOnly, translateException
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionExecutionListeners, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, prepareForCommit, prepareSynchronization, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionExecutionListeners, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.transaction.ConfigurableTransactionManager
addListener
Methods inherited from interface org.springframework.transaction.PlatformTransactionManager
commit, getTransaction, rollback
-
Constructor Details
-
GlueLazyDataSourceTransactionManager
public GlueLazyDataSourceTransactionManager()
-
-
Method Details
-
lazyCommit
- Specified by:
lazyCommit
in interfaceGlueLazyTransactionManager
- Throws:
GlueException
-
lazyRollback
- Specified by:
lazyRollback
in interfaceGlueLazyTransactionManager
- Throws:
GlueException
-
startTransaction
Description copied from interface:GlueTransactionManager
트랜잭션을 시작한다. 명시적으로startTransaction
메소드를 호출하지 않으면 트랜잭션이 작동하지 않는다.- Specified by:
startTransaction
in interfaceGlueTransactionManager
- Overrides:
startTransaction
in classGlueDataSourceTransactionManager
- Throws:
GlueException
- 트랜잭션 시작 실패 시
-
commit
Description copied from interface:GlueTransactionManager
트랜잭션을 커밋한다. 커밋 수행 후 새로운 트랜잭션을 시작하기 위해서는startThreadLocalTransaction
메소드를 호출해 주어야 한다.- Specified by:
commit
in interfaceGlueTransactionManager
- Overrides:
commit
in classGlueDataSourceTransactionManager
- Returns:
- 성공하면 true
- Throws:
GlueException
- 트랜잭션 커밋 실패 시
-
rollback
Description copied from interface:GlueTransactionManager
트랜잭션을 롤백한다. 롤백 수행 후 새로운 트랜잭션을 시작하기 위해서는startThreadLocalTransaction
메소드를 호출해 주어야 한다.- Specified by:
rollback
in interfaceGlueTransactionManager
- Overrides:
rollback
in classGlueDataSourceTransactionManager
- Returns:
- 성공하면 true
- Throws:
GlueException
- 트랜잭션을 롤백 실패 시
-
changeTransaction
Description copied from class:GlueDataSourceTransactionManager
ThreadLocal의 Transaction Status를 교체한다- Specified by:
changeTransaction
in interfaceGlueTransactionManager
- Overrides:
changeTransaction
in classGlueDataSourceTransactionManager
- Parameters:
ts
- 새롭게 ThreadLocal에 설정할 TransactionStatus- Returns:
- TransactionStatus 기존에 사용하고 있던 TransactionStatus
- Throws:
GlueException
-