Looking at the source of CMResourceService#stop
I believe I spotted a bug (I don't know what the implications are though).
The issue is on the line
jtaEnvironmentBean.getValue().getPerformImmediateCleanupOfCommitMarkableResourceBranchesMap().remove(immediateCleanup);
immediateCleanup is a Boolean
and the return type of getPerformImmediateCleanupOfCommitMarkableResourceBranchesMap()
is Map<String, Boolean>
So this line never does anything
I believe the line should read
jtaEnvironmentBean.getValue().getPerformImmediateCleanupOfCommitMarkableResourceBranchesMap().remove(jndiName);
because if we look a the #start method above we see
Map<String, Boolean> performImmediateCleanupOfConnectableResourceBranchesMap = jtaEnvironmentBean.getValue().getPerformImmediateCleanupOfCommitMarkableResourceBranchesMap(); performImmediateCleanupOfConnectableResourceBranchesMap.put(jndiName, immediateCleanup);
Should I file a JIRA?
That does look like a bug. So yes, please file a JIRA and issue a PR with your proposed change.