public class GlueDataSourceTransactionManager extends DataSourceTransactionManager implements GlueTransactionManager
Bean Property - dataSource : (필수) - transactionDefinition : (선택) 예제사용 예# 1 사용 예# 2 - Transaction Definition 추가
AbstractPlatformTransactionManager.SuspendedResourcesHolder
SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
Constructor and Description |
---|
GlueDataSourceTransactionManager() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
TransactionStatus |
changeTransaction(TransactionStatus ts)
ThreadLocal의 Transaction Status를 교체한다
|
boolean |
commit()
트랜잭션을 커밋한다.
|
boolean |
rollback()
트랜잭션을 롤백한다.
|
void |
setTransactionDefinition(TransactionDefinition def)
setter method for DI.
|
void |
startTransaction()
트랜잭션을 시작한다.
|
doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getDataSource, getResourceFactory, isEnforceReadOnly, isExistingTransaction, obtainDataSource, prepareTransactionalConnection, setDataSource, setEnforceReadOnly
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, prepareForCommit, prepareSynchronization, prepareTransactionStatus, registerAfterCompletionWithExistingTransaction, resume, rollback, setDefaultTimeout, setFailEarlyOnGlobalRollbackOnly, setGlobalRollbackOnParticipationFailure, setNestedTransactionAllowed, setRollbackOnCommitFailure, setTransactionSynchronization, setTransactionSynchronizationName, setValidateExistingTransaction, shouldCommitOnGlobalRollbackOnly, suspend, triggerBeforeCommit, triggerBeforeCompletion, useSavepointForNestedTransaction
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
commit, getTransaction, rollback
public void setTransactionDefinition(TransactionDefinition def)
def
- Transaction Definitionpublic void startTransaction() throws GlueException
GlueTransactionManager
startTransaction
메소드를 호출하지 않으면 트랜잭션이 작동하지 않는다.startTransaction
in interface GlueTransactionManager
GlueException
- 트랜잭션 시작 실패 시public boolean commit() throws GlueException
GlueTransactionManager
startThreadLocalTransaction
메소드를 호출해 주어야 한다.commit
in interface GlueTransactionManager
GlueException
- 트랜잭션 커밋 실패 시public boolean rollback() throws GlueException
GlueTransactionManager
startThreadLocalTransaction
메소드를 호출해 주어야 한다.rollback
in interface GlueTransactionManager
GlueException
- 트랜잭션을 롤백 실패 시public TransactionStatus changeTransaction(TransactionStatus ts) throws GlueException
changeTransaction
in interface GlueTransactionManager
ts
- 새롭게 ThreadLocal에 설정할 TransactionStatusGlueException
public void afterPropertiesSet()
afterPropertiesSet
in interface InitializingBean
afterPropertiesSet
in class DataSourceTransactionManager
Copyright © 2013–2021 POSCO ICT. All rights reserved.