A deadlock can occur if the TransactionRegistryCleaner fires when the TransactionManager destructor is called. The TransactionManager destructor holds the manager's monitor lock during the body of the destructor call and calls stop on the TransactionRegistryCleaner's WorkerTimer. If the TransactionRegistryCleaner's WorkerTimer fires during the destructor call (e.g. before stop is called), the timer handler will block on the manger's monitor lock. The WorkerTimer stop call in turn blocks waiting for the timer handler to complete. The deadlock occurs because the TransactionManager destructor holds the monitor and implicitly waits for the timer handler to complete and while the timer handler runs waiting for the monitor lock to become available.