[jboss-cvs] JBossAS SVN: r109372 - branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Nov 18 15:20:16 EST 2010
Author: jbertram at redhat.com
Date: 2010-11-18 15:20:16 -0500 (Thu, 18 Nov 2010)
New Revision: 109372
Modified:
branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java
Log:
JBPAPP-5432
Modified: branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java
===================================================================
--- branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java 2010-11-18 19:15:20 UTC (rev 109371)
+++ branches/JBPAPP_4_3_0_GA_CP08_JBPAPP-5432/transaction/src/main/org/jboss/tm/TransactionImpl.java 2010-11-18 20:20:16 UTC (rev 109372)
@@ -184,6 +184,8 @@
* Flags that we are done with this transaction and that it can be reused.
*/
private boolean done = false;
+
+ private boolean onePhaseCommitted = false;
// Static --------------------------------------------------------
@@ -270,12 +272,13 @@
case Status.STATUS_COMMITTING:
// This is _very_ bad:
- // We are in the second commit phase, and have decided
+ // If we are in the second commit phase, and have decided
// to commit, but now we get a timeout and should rollback.
// So we end up with a mixed decision.
- gotHeuristic(null, XAException.XA_HEURMIX);
+ if (getCommitStrategy() == 2)
+ gotHeuristic(null, XAException.XA_HEURMIX);
status = Status.STATUS_MARKED_ROLLBACK;
- return; // commit will fail
+ return; // 2-phase commit will fail, 1-phase commit *may* fail.
case Status.STATUS_PREPARED:
// This is bad:
@@ -361,13 +364,15 @@
status = Status.STATUS_COMMITTED; // all was read-only
}
}
-
+
if (status != Status.STATUS_COMMITTED)
{
Throwable causedByThrowable = cause;
- rollbackResources();
+ if (getCommitStrategy() == 2) {
+ rollbackResources();
+ }
completeTransaction();
-
+ checkHeuristics();
// throw jboss rollback exception with the saved off cause
throw new JBossRollbackException("Unable to commit, tx=" +
toString() + " status=" + getStringStatus(status),
@@ -1782,6 +1787,8 @@
try
{
resource.commit(onePhase);
+ if (onePhase)
+ onePhaseCommitted = true;
}
catch (XAException e)
{
@@ -1817,7 +1824,7 @@
}
}
- if (status == Status.STATUS_COMMITTING)
+ if (status == Status.STATUS_COMMITTING || onePhaseCommitted)
status = Status.STATUS_COMMITTED;
}
More information about the jboss-cvs-commits
mailing list