[exo-jcr-commits] exo-jcr SVN: r1433 - in jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src: test/java/org/exoplatform/services/jcr/api/xa and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Sat Jan 16 08:50:31 EST 2010


Author: tolusha
Date: 2010-01-16 08:50:31 -0500 (Sat, 16 Jan 2010)
New Revision: 1433

Modified:
   jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/XASessionImpl.java
   jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/xa/TestUserTransaction.java
Log:
EXOJCR-405: add XASession to txResourceManager on enlistResource() method

Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/XASessionImpl.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/XASessionImpl.java	2010-01-16 12:06:01 UTC (rev 1432)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/XASessionImpl.java	2010-01-16 13:50:31 UTC (rev 1433)
@@ -117,6 +117,7 @@
       {
          if (LOG.isDebugEnabled())
             LOG.debug("Delist session: " + getSessionInfo() + ", " + this);
+         txResourceManager.remove(this);
          tService.delistResource(this);
       }
       catch (RollbackException e)
@@ -138,6 +139,7 @@
       {
          if (LOG.isDebugEnabled())
             LOG.debug("Enlist session: " + getSessionInfo() + ", " + this);
+         txResourceManager.add(this);
          tService.enlistResource(this);
       }
       catch (RollbackException e)

Modified: jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/xa/TestUserTransaction.java
===================================================================
--- jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/xa/TestUserTransaction.java	2010-01-16 12:06:01 UTC (rev 1432)
+++ jcr/branches/1.12.0-JBCCACHE/exo.jcr.component.core/src/test/java/org/exoplatform/services/jcr/api/xa/TestUserTransaction.java	2010-01-16 13:50:31 UTC (rev 1433)
@@ -191,17 +191,19 @@
       Object obj = ctx.lookup("UserTransaction");
       UserTransaction ut = (UserTransaction)obj;
 
+      ut.begin();
+
       Session s1 =
          repository.login(new SimpleCredentials("admin", "admin".toCharArray()), session.getWorkspace().getName());
 
-      ut.begin();
       Node tx2 = s1.getRootNode().addNode("txcommit2");
       ut.commit();
 
+      ut.begin();
+
       // In a case of reusing Have to enlist the resource once again!
       ((XASession)s1).enlistResource();
 
-      ut.begin();
       tx2.addNode("txcommit21");
       s1.save();
       ut.commit();



More information about the exo-jcr-commits mailing list