You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Massimo Lusetti (JIRA)" <ji...@apache.org> on 2011/08/11 23:56:28 UTC

[jira] [Closed] (TAP5-137) org.hibernate.TransactionException thrown when a transaction is directly rolledback (outside of tapestry-hibernate)

     [ https://issues.apache.org/jira/browse/TAP5-137?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Massimo Lusetti closed TAP5-137.
--------------------------------

       Resolution: Won't Fix
    Fix Version/s: 5.3

Please open a new one for 5.3 if this still applicable

> org.hibernate.TransactionException thrown when a transaction is directly rolledback (outside of tapestry-hibernate)
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: TAP5-137
>                 URL: https://issues.apache.org/jira/browse/TAP5-137
>             Project: Tapestry 5
>          Issue Type: Bug
>    Affects Versions: 5.0.15
>            Reporter: Joe Klecko
>            Priority: Minor
>             Fix For: 5.3
>
>
> A "org.hibernate.TransactionException: Transaction not successfully started " occurs when a transaction is rolledback in tapestry-hibernate if the transaction has previously been rolledback.   The problem is because HibernateSessionManagerImpl retains a reference to the transaction. So when HibernateSessionManagerImpl .threadDidCleanup() or HibernateSessionManagerImpl abort() is called it does not first check to see if the transaction reference has been rolled back (somewhere else) before calling rollback.  One possible fix would be to call Transaction.wasRolledback() to determine if tapestry-hibernate should call trans.rollback(). Another would be to refrain from keeping a reference to the transaction and always call Session.beginTransaction().
> Q. Why not just inject HibernateSessionManager and call abort()? 
> A. Because there are times when you do not have control over the code calling trans.rollback() for example in a third party library (which is how I ran into this).

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira