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

AtomicAction and ThreadActionData cleanup is broken

    XMLWordPrintable

Details

    Description

      ThreadActionData emlpoys a ThreadLocal to maintain the association between threads and actions. This means that the association can only be removed by the associated thread. The finalize method on AtomicAction attempts, amongst other things, to ensure this association is broken by calling ThreadActionData.purgeAction(). Unfortunately it passes the current thread (the Finalizer thread) which means that the association is still retained. This also fails to remove any child thread from the basic action's child thread list for the same reason. Because it has no way of establishing the prior association this finalize method is an expensive waste of time. It would be best deleted.

      Also, another detail of this cleanup is wrong. AtomicAction.removeThread(t) currently calls ThreadActionData.purgeAction(this). It should call ThreadActionData.purgeAction(this, t). This change would allow a cleanup thread which knows about the association to remove the correct child thread from the basic action's child thread list. However, it will oto get round the problem that ThreadActionData is using a ThreadLocal. Again, since there is no way of knowing the prior association this method is probably redundant.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: