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

Shutdown the ExpiredEntryMonitor when stopping the RecoveryManager

    XMLWordPrintable

    Details

    • Type: Feature Request
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.5.0
    • Fix Version/s: 4.8.0
    • Component/s: Recovery
    • Labels:
      None
    • Environment:

      Tomcat + Spring + DBCP + JBossJTA

      Description

      When the recovery manager is started, the implementation RecoveryManagerImple starts the ExpiredEntryMonitor.
      When you stop the recovery manager, however, the ExpiredEntryMonitor is not shut down.

      On line 250 of com.arjuna.ats.internal.arjuna.recovery.RecoveryManagerImple there's the line ExpiredEntryMonitor.shutdown() commented out, with a "TODO why?" comment immediately before.

      I don't know exactly what should be the lifecylce of ExpiredEntryMonitor versus that of RecoveryManagerImple, however I think that one of the following should happen:

      • ExpiredEntryMonitor is started when RecoveryManagerImple is started (rather than constructed), so that it is shut down when the RecoveryManagerImple is stopped
        OTHERWISE
      • RecoveryManagerImple provides a way to "dispose" or "disable" it and this includes the shutdown of ExpiredEntryMonitor
        OTHERWISE
      • it is documented that stopping the recovery manager needs the ExpiredEntryMonitor to be stopped too: however, please consider that com.arjuna.ats.internal.arjuna.recovery.ExpiredEntryMonitor.shutdown() throws a NullPointerException if called while the ExpiredEntryMonitor has not been started before and there is no public method to test if it has been started or not; so if I need to write some code that stops the ExpiredEntryMonitor (without knowing if it has been started or not) I have to write some ugly code like:
      try
      {
        ExpiredEntryMonitor.shutdown();
      }
      catch(final NullPointerException e)
      {
        // ExpiredEntryMonitor had not been started
      }
      

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  adinn Andrew Dinn
                  Reporter:
                  mauromol Mauro Molinari
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: