com.poscoict.glueframework.transaction
Class GlueHibernateTransactionManager

java.lang.Object
  extended by org.springframework.transaction.support.AbstractPlatformTransactionManager
      extended by org.springframework.orm.hibernate3.HibernateTransactionManager
          extended by com.poscoict.glueframework.transaction.GlueHibernateTransactionManager
All Implemented Interfaces:
GlueTransactionManager, Serializable, Aware, BeanFactoryAware, InitializingBean, PlatformTransactionManager, ResourceTransactionManager

public class GlueHibernateTransactionManager
extends HibernateTransactionManager
implements GlueTransactionManager

HibernateTransactionManager È®Àå. Data SourceÀÇ Æ®·£Àè¼ÇÀ» °ü¸®ÇÏ´Â Manager Ŭ·¡½ºÀÌ´Ù. ³»ºÎÀûÀ¸·Î Spring Framework¿¡¼­ Á¦°øÇÏ´Â HibernateTransactionManager¸¦ »ç¿ëÇÑ´Ù.

 Bean Property
 
 - sessionFactory : (Çʼö)
 
 
 
 ¿¹Á¦
 »ç¿ë ¿¹# 1
 
     <bean id="tx" class="com.poscoict.glueframework.transaction.GlueHibernateTransactionManager">
         <property name="sessionFactory" ref="sessionFactory"/>
     </bean>
     <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
         <property name="dataSource" ref="ds"/>
         <property name="mappingResources">
             <list>
                 <value>HbSample01.hbm.xml</value>
             </list>
         </property>
         <property name="hibernateProperties">
             <props>
                 <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect</prop>
                 <prop key="hibernate.show_sql">true</prop>
                 <prop key="hibernate.transaction.flush_before_completion">false</prop>
             </props>
         </property>
     </bean>
     <bean id="ds" class="..."/>
 

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
SYNCHRONIZATION_ALWAYS, SYNCHRONIZATION_NEVER, SYNCHRONIZATION_ON_ACTUAL_TRANSACTION
 
Constructor Summary
GlueHibernateTransactionManager()
           
GlueHibernateTransactionManager(org.hibernate.SessionFactory sessionFactory)
           
 
Method Summary
 TransactionStatus changeTransaction(TransactionStatus ts)
          ThreadLocalÀÇ Transaction Status¸¦ ±³Ã¼ÇÑ´Ù
 boolean commit()
          Æ®·£Àè¼ÇÀ» Ä¿¹ÔÇÑ´Ù.
protected  TransactionStatus getTransactionStatus()
           
 boolean rollback()
          Æ®·£Àè¼ÇÀ» ·Ñ¹éÇÑ´Ù.
 void setTransactionDefinition(TransactionDefinition def)
          setter method for DI.
 void startTransaction()
          Æ®·£Àè¼ÇÀ» ½ÃÀÛÇÑ´Ù.
 
Methods inherited from class org.springframework.orm.hibernate3.HibernateTransactionManager
afterPropertiesSet, convertHibernateAccessException, convertJdbcAccessException, doBegin, doCleanupAfterCompletion, doCommit, doGetTransaction, doResume, doRollback, doSetRollbackOnly, doSuspend, getDataSource, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getJdbcExceptionTranslator, getResourceFactory, getSessionFactory, isExistingTransaction, isSameConnectionForEntireSession, prepareForCommit, setAutodetectDataSource, setBeanFactory, setDataSource, setEarlyFlushBeforeCommit, setEntityInterceptor, setEntityInterceptorBeanName, setHibernateManagedSession, setJdbcExceptionTranslator, setPrepareConnection, setSessionFactory
 
Methods inherited from class org.springframework.transaction.support.AbstractPlatformTransactionManager
commit, determineTimeout, getDefaultTimeout, getTransaction, getTransactionSynchronization, invokeAfterCompletion, isFailEarlyOnGlobalRollbackOnly, isGlobalRollbackOnParticipationFailure, isNestedTransactionAllowed, isRollbackOnCommitFailure, isValidateExistingTransaction, newTransactionStatus, 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

GlueHibernateTransactionManager

public GlueHibernateTransactionManager()

GlueHibernateTransactionManager

public GlueHibernateTransactionManager(org.hibernate.SessionFactory sessionFactory)
Parameters:
sessionFactory -
Method Detail

getTransactionStatus

protected TransactionStatus getTransactionStatus()
Returns:

setTransactionDefinition

public void setTransactionDefinition(TransactionDefinition def)
setter method for DI.

Parameters:
def -

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 TransactionStatus changeTransaction(TransactionStatus ts)
                                    throws GlueException
Description copied from interface: GlueTransactionManager
ThreadLocalÀÇ Transaction Status¸¦ ±³Ã¼ÇÑ´Ù

Specified by:
changeTransaction in interface GlueTransactionManager
Returns:
TransactionStatus ±âÁ¸¿¡ »ç¿ëÇÏ°í ÀÖ´ø TransactionStatus
Throws:
GlueException


Copyright © 2013–2017 POSCO ICT. All rights reserved.