public class GlueDataSourceTransactionManager extends org.springframework.jdbc.datasource.DataSourceTransactionManager implements GlueTransactionManager
Bean Property - dataSource : (필수) - transactionDefinition : (선택) 예제사용 예# 1 사용 예# 2 - Transaction Definition 추가
Constructor and Description |
---|
GlueDataSourceTransactionManager() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet() |
org.springframework.transaction.TransactionStatus |
changeTransaction(org.springframework.transaction.TransactionStatus ts)
ThreadLocal의 Transaction Status를 교체한다
|
boolean |
commit()
트랜잭션을 커밋한다.
|
boolean |
rollback()
트랜잭션을 롤백한다.
|
void |
setTransactionDefinition(org.springframework.transaction.TransactionDefinition def)
setter method for DI.
|
void |
startTransaction()
트랜잭션을 시작한다.
|
doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getDataSource, getResourceFactory, isEnforceReadOnly, isExistingTransaction, obtainDataSource, prepareTransactionalConnection, setDataSource, setEnforceReadOnly, translateException
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
public void setTransactionDefinition(org.springframework.transaction.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 org.springframework.transaction.TransactionStatus changeTransaction(org.springframework.transaction.TransactionStatus ts) throws GlueException
changeTransaction
in interface GlueTransactionManager
ts
- 새롭게 ThreadLocal에 설정할 TransactionStatusGlueException
public void afterPropertiesSet()
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
afterPropertiesSet
in class org.springframework.jdbc.datasource.DataSourceTransactionManager
Copyright © 2023–2024 POSCO DX. All rights reserved.