Skip to content

Instantly share code, notes, and snippets.

@mbechler
Created September 19, 2015 12:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbechler/4be88aaa3d350a91db8a to your computer and use it in GitHub Desktop.
Save mbechler/4be88aaa3d350a91db8a to your computer and use it in GitHub Desktop.
--- com/atomikos/datasource/xa/XAResourceTransaction.java 2014-03-23 09:14:10.000000000 +0100
+++ com/atomikos/datasource/xa/XAResourceTransaction.java 2015-09-18 14:13:53.810419822 +0200
@@ -465,7 +465,7 @@
boolean recovered = false;
// perform extra initialization
- if (beforePrepare()) {
+ if (getXAResource() != null && beforePrepare()) {
// see case 23364: recovery before prepare should do nothing
// and certainly not reset the xaresource
return false;
@@ -860,7 +860,7 @@
// enlist/delist on different xaresource instances.
// This should not interfere with recovery since a recovered
// instance will NOT have state ACTIVE...
- if (!TxState.ACTIVE.equals(this.state)) {
+ if (this.xaresource == null || !TxState.ACTIVE.equals(this.state)) {
setXAResource(xaresource);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment