2 Replies Latest reply on Apr 23, 2010 5:18 PM by Daniel Spangler

    nested transactions with spring integration

    Daniel Spangler Newbie
      I'm having trouble with the spring integration when using nested transactions.  Regular transactions work fine but I get the following exception if a transactional been calls a method marked with
      @Transactional(propagation=Propagation.REQUIRES_NEW). Any help would be greatly appreciated.

      Thanks in advance,

      Daniel


      2009-03-10 10:53:18,288 INFO  [STDOUT] 10:53:18,286 ERROR [AdminCommandImpl] Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException: Transaction already active
      org.springframework.transaction.CannotCreateTransactionException: Could not open JPA EntityManager for transaction; nested exception is java.lang.IllegalStateException: Transaction already active
           at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:375)
           at org.springframework.transaction.support.AbstractPlatformTransactionManager.handleExistingTransaction(AbstractPlatformTransactionManager.java:424)
           at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:353)
           at org.springframework.transaction.interceptor.TransactionAspectSupport.createTransactionIfNecessary(TransactionAspectSupport.java:263)
           at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:101)
           at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
           at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)
           at com.-------.------------.audit.AuditManager$$EnhancerByCGLIB$$4aa77607.auditInNewTransaction(<generated>)
      ...