Uploaded image for project: 'Spring.NET'
  1. Spring.NET
  2. SPRNET-1410

HibernateTxScopeTransactionManager throws "could not rollback hibernate transaction" if it dioes not check for zombied transaction

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.0
    • Fix Version/s: 1.3.2
    • Component/s: Spring-NET-TX
    • Labels:
      None
    • Environment:
      Windows 7, WCF hosted within IIS

      Description

      I have a nested call hierarchy with several classes annoted with Spring.NET [Transaction]. Somewhere I throw a validation exception. The transaction gets rolled back in the deepest level of the call hierarchy. All other methods throw a "could not rollback hibernate transaction" because the AOP nterceptor wants to roll back an already rolled back transaction (my guess).

      Implementing HibernateTxScopeTransactionManager helps:

      public class MBTxScopeTransactionManager : Spring.Data.NHibernate.HibernateTxScopeTransactionManager
      {
      protected override void DoRollback(Spring.Transaction.Support.DefaultTransactionStatus status)

      { var currentSession = this.SessionFactory.GetCurrentSession(); if(currentSession != null && currentSession.Transaction != null && currentSession.Transaction.IsActive) base.DoRollback(status); }

      }

        Attachments

          Activity

            People

            • Assignee:
              sbohlen Steve Bohlen
              Reporter:
              mbeller Maximilian Beller
            • Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: