ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/50] [abbrv] incubator-ignite git commit: IGNITE-591 Make GridCacheXAResource shared.
Date Fri, 10 Jul 2015 10:46:55 GMT
IGNITE-591 Make GridCacheXAResource shared.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/4b06e77c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/4b06e77c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/4b06e77c

Branch: refs/heads/ignite-1056
Commit: 4b06e77c8e770f9b9ef8b34b59a69ec47da615c7
Parents: 1a21477
Author: sevdokimov <sergey.evdokimov@jetbrains.com>
Authored: Wed Jul 1 10:08:13 2015 +0300
Committer: sevdokimov <sergey.evdokimov@jetbrains.com>
Committed: Wed Jul 1 10:08:13 2015 +0300

----------------------------------------------------------------------
 .../processors/cache/jta/CacheJtaManager.java       |  4 ++--
 .../processors/cache/jta/GridCacheXAResource.java   | 16 ++++++----------
 .../processors/cache/GridCacheJtaSelfTest.java      |  2 --
 3 files changed, 8 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b06e77c/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
index 9af29d6..2a078dc 100644
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/CacheJtaManager.java
@@ -30,7 +30,7 @@ import javax.transaction.*;
  */
 public class CacheJtaManager extends CacheJtaManagerAdapter {
     /** */
-    private final ThreadLocal<GridCacheXAResource> xaRsrc = new ThreadLocal<>();
+    private final static ThreadLocal<GridCacheXAResource> xaRsrc = new ThreadLocal<>();
 
     /** */
     private TransactionManager jtaTm;
@@ -89,7 +89,7 @@ public class CacheJtaManager extends CacheJtaManagerAdapter {
                             );
                         }
 
-                        rsrc = new GridCacheXAResource(tx, cctx);
+                        rsrc = new GridCacheXAResource(tx, cctx.kernalContext());
 
                         if (!jtaTx.enlistResource(rsrc))
                             throw new IgniteCheckedException("Failed to enlist XA resource
to JTA user transaction.");

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b06e77c/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
index 442cdde..ad233e5 100644
--- a/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
+++ b/modules/jta/src/main/java/org/apache/ignite/internal/processors/cache/jta/GridCacheXAResource.java
@@ -18,7 +18,7 @@
 package org.apache.ignite.internal.processors.cache.jta;
 
 import org.apache.ignite.*;
-import org.apache.ignite.internal.processors.cache.*;
+import org.apache.ignite.internal.*;
 import org.apache.ignite.internal.processors.cache.transactions.*;
 import org.apache.ignite.internal.util.typedef.internal.*;
 import org.apache.ignite.transactions.*;
@@ -41,9 +41,6 @@ public final class GridCacheXAResource implements XAResource {
     /** */
     private static final Xid[] NO_XID = new Xid[] {};
 
-    /** Context. */
-    private GridCacheContext cctx;
-
     /** Cache transaction. */
     private IgniteInternalTx cacheTx;
 
@@ -52,17 +49,16 @@ public final class GridCacheXAResource implements XAResource {
 
     /**
      * @param cacheTx Cache jta.
-     * @param cctx Cache context.
+     * @param ctx Kernal context.
      */
-    public GridCacheXAResource(IgniteInternalTx cacheTx, GridCacheContext cctx) {
+    public GridCacheXAResource(IgniteInternalTx cacheTx, GridKernalContext ctx) {
         assert cacheTx != null;
-        assert cctx != null;
+        assert ctx != null;
 
-        this.cctx = cctx;
         this.cacheTx = cacheTx;
 
         if (log == null)
-            log = U.logger(cctx.kernalContext(), logRef, GridCacheXAResource.class);
+            log = U.logger(ctx, logRef, GridCacheXAResource.class);
     }
 
     /** {@inheritDoc} */
@@ -229,7 +225,7 @@ public final class GridCacheXAResource implements XAResource {
 
         GridCacheXAResource other = (GridCacheXAResource)xar;
 
-        return cctx == other.cctx;
+        return cacheTx == other.cacheTx;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/4b06e77c/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaSelfTest.java
b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaSelfTest.java
index b299f8d..37e9ed2 100644
--- a/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaSelfTest.java
+++ b/modules/jta/src/test/java/org/apache/ignite/internal/processors/cache/GridCacheJtaSelfTest.java
@@ -151,8 +151,6 @@ public class GridCacheJtaSelfTest extends GridCacheAbstractSelfTest {
      */
     @SuppressWarnings("ConstantConditions")
     public void testJtaTwoCaches() throws Exception {
-        fail("https://issues.apache.org/jira/browse/IGNITE-591");
-
         UserTransaction jtaTx = jotm.getUserTransaction();
 
         IgniteEx ignite = grid(0);


Mime
View raw message