Class TransactionWrapper

java.lang.Object
org.springframework.transaction.interceptor.TransactionAspectSupport
com.foreach.across.modules.hibernate.support.TransactionWrapper
All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean

public class TransactionWrapper extends org.springframework.transaction.interceptor.TransactionAspectSupport
Extension of TransactionAspectSupport thas accepts a callback function to be executed in a fixed transaction. If an outer transaction is already present, it should be reused. If no transaction active yet, a new one will be created with the default attributes.

Unless a different TransactionAttributeSource is configured the default transaction only has the PROPAGATION_REQUIRED attribute set.

Since:
2.0.0
Author:
Arne Vandamme
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
     

    Nested classes/interfaces inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport

    org.springframework.transaction.interceptor.TransactionAspectSupport.TransactionInfo
  • Field Summary

    Fields inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> R
     
    protected String
    methodIdentification(Method method, Class<?> targetClass)
     

    Methods inherited from class org.springframework.transaction.interceptor.TransactionAspectSupport

    afterPropertiesSet, cleanupTransactionInfo, clearTransactionManagerCache, commitTransactionAfterReturning, completeTransactionAfterThrowing, createTransactionIfNecessary, currentTransactionInfo, currentTransactionStatus, determineTransactionManager, getBeanFactory, getTransactionAttributeSource, getTransactionManager, getTransactionManagerBeanName, invokeWithinTransaction, prepareTransactionInfo, setBeanFactory, setTransactionAttributes, setTransactionAttributeSource, setTransactionAttributeSources, setTransactionManager, setTransactionManagerBeanName

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TransactionWrapper

      public TransactionWrapper()
  • Method Details

    • invokeWithinTransaction

      public <R> R invokeWithinTransaction(TransactionWrapper.InvocationCallback<R> callback) throws Throwable
      Throws:
      Throwable
    • methodIdentification

      protected String methodIdentification(Method method, Class<?> targetClass)
      Overrides:
      methodIdentification in class org.springframework.transaction.interceptor.TransactionAspectSupport