Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-770

incorrect cleanup registration causes memory leak

    XMLWordPrintable

Details

    Description

      jts.TransactionImple constructors attempt to optimize the cleanup callback needed to remove entries from _transactions, bypassing the ORB for interposition scenarios:

      theTx = (TwoPhaseCoordinator) BasicAction.Current();

      if (theTx != null) {
      theTx.addSynchronization(new LocalCleanupSynchronization(this));
      } else {
      registerSynchronization(new CleanupSynchronization(this));
      }

      Unfortunately this does not work and leads to memory leaks on _transactions in certain cases. Specifically, where theTx is a ServerTransaction (i.e. extends ArjunaTransactionImple, which extends TwoPhaseCoordinator), the callbacks run (by ArjunaTransactionImple.do[Before|After]Completion()) are those in ArjunaTransactionImple._syncs, not the masked ones in TwoPhaseCoordinator._syncs. Thus using TwoPhaseCoordinator.addSynchronization registers a callback which is never invoked.

      Attachments

        Issue Links

          Activity

            People

              rhn-engineering-jhallida Jonathan Halliday
              rhn-engineering-jhallida Jonathan Halliday
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: