Class XATransactionState.CleanupOrCancelMonitor

java.lang.Object
org.apache.derby.jdbc.XATransactionState.CleanupOrCancelMonitor
Enclosing class:
XATransactionState

private static class XATransactionState.CleanupOrCancelMonitor extends Object
A class used to monitor if the transaction is in the middle of cancelling or cleaning up on an error. See DERBY-6879
  • Field Details

    • cancelThreadId

      private Long cancelThreadId
    • cleanupThreadId

      private Long cleanupThreadId
  • Constructor Details

    • CleanupOrCancelMonitor

      private CleanupOrCancelMonitor()
  • Method Details

    • okToCancel

      public boolean okToCancel()
      See if it is ok to cancel. It is okay to cancel if the transaction is not cleaning up from an error. The assumption is that if the cleanUpOnError is/has been invoked, then there is no reason for the cancel to be processed as the transaction is going to end (ab)normally.
      Returns:
      true if it is okay to cancel.
    • okToCleanup

      private boolean okToCleanup()
      See if it is ok to cleanup. It is okay to cleanup if the transaction is not cancelling. The assumption is that if the cancel is/has been invoked, then there is no reason to try to mark the transaction as being in error. The transaction will be cancelled in any case.
      Returns:
      true if it is okay to cleanup.