Ok, the transaction is being rollback, but then there is something i
don't get about @CommitAfter.

What happens if a @CommitAfter method calls a different @CommitAfter
method? Are the transactions nested? would the whole transaction will
only be committed after the first method returns? or would there be a
different transaction for each of the methods?

Thanks

On 3/9/09, Juan E. Maya <maya.j...@gmail.com> wrote:
> Hello, i've using tapestry-hibernate with the latest snapshot but i am
> having issues with transaction rollbacks.
>
> I am using Derby and Hibernate configured  with autocommit=false, but
> if i throw a RuntimeException the transaction is never rolled back. In
> the stack trace i can see that the HibernateTransactionAdvisorImpl is
> throwing back exception, what means that the transaction is being
> aborted, but in my database i still can see the data.
>
> This is the stack trace i get:
> Caused by: java.lang.RuntimeException: rollback?
>       at
> com.dodo.profiler.core.service.visit.impl.VisitManagerImpl.addVisits(VisitManagerImpl.java:107)
>       at
> Invocation$VisitManager$addVisits$11fea375779.invokeDelegateMethod(Invocation$VisitManager$addVisits$11fea375779.java)
>       at
> org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:117)
>       at
> org.apache.tapestry5.internal.hibernate.HibernateTransactionAdvisorImpl$1.advise(HibernateTransactionAdvisorImpl.java:40)
>       at
> org.apache.tapestry5.ioc.internal.services.AbstractInvocation.proceed(AbstractInvocation.java:121)
>       at $VisitManager_11fea373b0a.addVisits($VisitManager_11fea373b0a.java)
>       at $VisitManager_11fea373ad9.addVisits($VisitManager_11fea373ad9.java)
>
>
> The VisitManager inteface looks like this:
>
> public interface VisitManager {
>     @CommitAfter
>     public void addVisits(NewVisitsParameters newVisitsParameters);
> }
>
>
> And the tapestry-hibernate configuration adds the advise:
>       @Match("*Manager")
>       public static void adviseTransactions(HibernateTransactionAdvisor 
> advisor,
>                       MethodAdviceReceiver receiver) {
>               advisor.addTransactionCommitAdvice(receiver);
>       }
>
> Thanks a lot for your help
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to