[exo-jcr-commits] exo-jcr SVN: r1476 - jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session.
do-not-reply at jboss.org
do-not-reply at jboss.org
Tue Jan 19 07:15:18 EST 2010
Author: pnedonosko
Date: 2010-01-19 07:15:17 -0500 (Tue, 19 Jan 2010)
New Revision: 1476
Modified:
jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
Log:
EXOJCR-405 commit exception for two-phase is XA_RBOTHER
Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2010-01-19 11:34:34 UTC (rev 1475)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/session/TransactionableResourceManager.java 2010-01-19 12:15:17 UTC (rev 1476)
@@ -176,10 +176,10 @@
}
catch (TransactionException e)
{
- boolean mixedCommit = i > 0;
if (onePhase)
{
// rollback now
+ boolean mixedCommit = i > 0;
for (; i < joinedList.size(); i++)
{
SoftReference<XASessionImpl> sr = joinedList.get(i);
@@ -189,59 +189,20 @@
xaSession.getTransientNodesManager().getTransactManager().rollback();
}
}
- }
-
- if (mixedCommit)
- {
- // somethings were commited already
- throw new TransactionException(XAException.XA_HEURMIX, e);
- }
- else
- {
- // all things were rolled back
- throw new TransactionException(XAException.XA_HEURRB, e);
- }
- }
- }
- }
-
- /**
- * TODO proposal
- * @param userSession
- * @throws TransactionException
- */
- private void commit1(XASessionImpl userSession) throws TransactionException
- {
- List<XASessionImpl> xaSessions = null;
- synchronized (this)
- {
- List<SoftReference<XASessionImpl>> joinedList = txResources.remove(userSession.getUserID());
- if (joinedList != null)
- for (SoftReference<XASessionImpl> sr : joinedList)
- {
- XASessionImpl xaSession = sr.get();
- if (xaSession != null)
+
+ if (mixedCommit)
{
- if (xaSessions == null)
- {
- xaSessions = new ArrayList<XASessionImpl>();
- }
- xaSessions.add(xaSession);
+ // somethings were commited already
+ throw new TransactionException(XAException.XA_HEURMIX, e);
}
- }
- }
- if (xaSessions != null)
- {
- for (XASessionImpl xaSession : xaSessions)
- {
- synchronized (xaSession)
- {
- if (xaSession.isLive())
+ else
{
- TransactionableDataManager txManager = xaSession.getTransientNodesManager().getTransactManager();
- txManager.commit();
+ // all things were rolled back
+ throw new TransactionException(XAException.XA_HEURRB, e);
}
}
+
+ throw new TransactionException(XAException.XA_RBOTHER, e);
}
}
}
More information about the exo-jcr-commits
mailing list