1 Reply Latest reply on Apr 25, 2011 2:35 PM by Geraldo Ferraz

    HibernateEntityHome & raiseAfterTransactionSuccessEvent

    Osian Hughes Newbie

      Hi,


      I seem to have encountered a problem, where once an object has been saved through tehe HibernateEntityHome.update method, a raiseAfterTransactionSuccessEvent is called, but the HibernateEntityTransaction is never initialised properly, i.e. the begin is not called, therefore when assertActive is called the transaction is not active.


      Below is the exception raised


      java.lang.IllegalStateException: transaction is not active
           org.jboss.seam.transaction.HibernateTransaction.assertActive(HibernateTransaction.java:166)
           org.jboss.seam.transaction.HibernateTransaction.registerSynchronization(HibernateTransaction.java:186)
           org.jboss.seam.async.AbstractDispatcher.scheduleTransactionSuccessEvent(AbstractDispatcher.java:90)
           sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           java.lang.reflect.Method.invoke(Method.java:597)
           org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
           org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
           org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
           org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
           org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
           org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
           org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
           org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:185)
           org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:103)
           org.jboss.seam.async.ThreadPoolDispatcher_$$_javassist_17.scheduleTransactionSuccessEvent(ThreadPoolDispatcher_$$_javassist_17.java)
           org.jboss.seam.core.Events.raiseTransactionSuccessEvent(Events.java:126)
           org.jboss.seam.framework.Controller.raiseTransactionSuccessEvent(Controller.java:267)
           org.jboss.seam.framework.Home.raiseAfterTransactionSuccessEvent(Home.java:459)
           org.jboss.seam.framework.HibernateEntityHome.update(HibernateEntityHome.java:42)
      



      This is using SEAM 2.1.1.GA


      Thanks,
      Osian