com.poscoict.glueframework.transaction
Class GlueDataSourceTransactionManager

java.lang.Object
  extended by org.springframework.transaction.support.AbstractPlatformTransactionManager
      extended by org.springframework.jdbc.datasource.DataSourceTransactionManager
          extended by com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager
All Implemented Interfaces:
GlueTransactionManager, Serializable, org.springframework.beans.factory.InitializingBean, org.springframework.transaction.PlatformTransactionManager, org.springframework.transaction.support.ResourceTransactionManager

public class GlueDataSourceTransactionManager
extends org.springframework.jdbc.datasource.DataSourceTransactionManager
implements GlueTransactionManager

Data SourceÀÇ Æ®·£Àè¼ÇÀ» °ü¸®ÇÏ´Â Manager Ŭ·¡½ºÀÌ´Ù. ³»ºÎÀûÀ¸·Î Spring Framework¿¡¼­ Á¦°øÇÏ´Â DataSourceTransactionManager¸¦ »ó¼Ó¹Þ´Â´Ù.

 Bean Property
 
 - dataSource : (Çʼö)
 
 - transactionDefinition : (¼±ÅÃ)
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <bean id="tx" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
         <property name="dataSource" ref="dataSource"/>
     </bean>
 
 
 »ç¿ë ¿¹# 2
 - Transaction Definition Ãß°¡
     <bean id="tx" class="com.poscoict.glueframework.transaction.GlueDataSourceTransactionManager">
         <property name="dataSource" ref="dataSource"/>
         <property name="transactionDefinition" ref="txDef"/>
     </bean>
     <!-- Transaction Definition -->
     <bean id="txDef" class="com.poscoict.glueframework.transaction.GlueDefaultTransactionDefinition">
          <property name="isolationLevelName" value="ISOLATION_DEFAULT"/>
          <property name="propagationBehaviorName" value="PROPAGATION_REQUIRED_NEW"/>
          <property name="readOnly" value="false"/>
          <property name="timeout" value="100"/>
     </bean>
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
org.springframework.transaction.support.AbstractPlatformTransactionManager.SuspendedResourcesHolder
 
Field Summary
 
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
 
Constructor Summary
GlueDataSourceTransactionManager()
           
 
Method Summary
 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()
          Æ®·£Àè¼ÇÀ» ½ÃÀÛÇÑ´Ù.
 
Methods inherited from class org.springframework.jdbc.datasource.DataSourceTransactionManager
doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getDataSource, getResourceFactory, isExistingTransaction, setDataSource
 
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
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
 
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.PlatformTransactionManager
commit, getTransaction, rollback
 

Constructor Detail

GlueDataSourceTransactionManager

public GlueDataSourceTransactionManager()
Method Detail

setTransactionDefinition

public void setTransactionDefinition(org.springframework.transaction.TransactionDefinition def)
setter method for DI. Transaction DefinitionÀ» ¼³Á¤ÇÑ´Ù.

Parameters:
def - Transaction Definition

startTransaction

public void startTransaction()
                      throws GlueException
Description copied from interface: GlueTransactionManager
Æ®·£Àè¼ÇÀ» ½ÃÀÛÇÑ´Ù. ¸í½ÃÀûÀ¸·Î startTransaction ¸Þ¼Òµå¸¦ È£ÃâÇÏÁö ¾ÊÀ¸¸é Æ®·£Àè¼ÇÀÌ ÀÛµ¿ÇÏÁö ¾Ê´Â´Ù.

Specified by:
startTransaction in interface GlueTransactionManager
Throws:
GlueException - Æ®·£Àè¼Ç ½ÃÀÛ ½ÇÆÐ ½Ã

commit

public boolean commit()
               throws GlueException
Description copied from interface: GlueTransactionManager
Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù. Ä¿¹Ô ¼öÇà ÈÄ »õ·Î¿î Æ®·£Àè¼ÇÀ» ½ÃÀÛÇϱâ À§Çؼ­´Â startThreadLocalTransaction ¸Þ¼Òµå¸¦ È£ÃâÇØ ÁÖ¾î¾ß ÇÑ´Ù.

Specified by:
commit in interface GlueTransactionManager
Returns:
¼º°øÇϸé true
Throws:
GlueException - Æ®·£Àè¼Ç Ä¿¹Ô ½ÇÆÐ ½Ã

rollback

public boolean rollback()
                 throws GlueException
Description copied from interface: GlueTransactionManager
Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù. ·Ñ¹é ¼öÇà ÈÄ »õ·Î¿î Æ®·£Àè¼ÇÀ» ½ÃÀÛÇϱâ À§Çؼ­´Â startThreadLocalTransaction ¸Þ¼Òµå¸¦ È£ÃâÇØ ÁÖ¾î¾ß ÇÑ´Ù.

Specified by:
rollback in interface GlueTransactionManager
Returns:
¼º°øÇϸé true
Throws:
GlueException - Æ®·£Àè¼ÇÀ» ·Ñ¹é ½ÇÆÐ ½Ã

changeTransaction

public org.springframework.transaction.TransactionStatus changeTransaction(org.springframework.transaction.TransactionStatus ts)
                                                                    throws GlueException
ThreadLocalÀÇ Transaction Status¸¦ ±³Ã¼ÇÑ´Ù

Specified by:
changeTransaction in interface GlueTransactionManager
Parameters:
TransactionStatus - »õ·Ó°Ô ThreadLocal¿¡ ¼³Á¤ÇÒ TransactionStatus
Returns:
TransactionStatus ±âÁ¸¿¡ »ç¿ëÇÏ°í ÀÖ´ø TransactionStatus
Throws:
GlueException

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class org.springframework.jdbc.datasource.DataSourceTransactionManager


Copyright © 2013–2015 POSCO ICT SWÁ¦Ç°±â¼úÆÀ. All rights reserved.