ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [04/18] incubator-ignite git commit: GG-9141 - Fixing tests for clients suite.
Date Tue, 16 Dec 2014 15:12:07 GMT
GG-9141 - Fixing tests for clients suite.


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

Branch: refs/heads/ignite-41
Commit: 0cb0c334f10e512ca546611609052aee012c5b59
Parents: ee2df1d
Author: Alexey Goncharuk <agoncharuk@gridgain.com>
Authored: Sun Dec 14 10:42:59 2014 -0800
Committer: Alexey Goncharuk <agoncharuk@gridgain.com>
Committed: Sun Dec 14 10:42:59 2014 -0800

----------------------------------------------------------------------
 .../GridClientAbstractMultiNodeSelfTest.java    |  9 +++--
 .../client/suite/GridClientTestSuite.java       |  4 ---
 .../processors/cache/GridCacheAdapter.java      | 13 +++++--
 .../processors/cache/GridCacheTxAdapter.java    | 36 ++++++++++++++++++--
 .../kernal/processors/cache/GridCacheTxEx.java  |  8 ++++-
 .../processors/cache/GridCacheTxHandler.java    |  4 ++-
 .../cache/GridCacheTxLocalAdapter.java          | 29 ++++------------
 .../processors/cache/GridCacheTxManager.java    |  2 ++
 .../dht/GridDhtTransactionalCacheAdapter.java   |  2 ++
 .../distributed/dht/GridDhtTxLocalAdapter.java  | 19 ++---------
 .../colocated/GridDhtColocatedLockFuture.java   |  2 +-
 .../distributed/near/GridNearLockFuture.java    |  2 +-
 .../distributed/near/GridNearLockRequest.java   | 25 ++++++++++++++
 .../cache/distributed/near/GridNearTxLocal.java | 15 +++++---
 .../processors/cache/local/GridLocalTx.java     |  2 +-
 .../transactions/IgniteTransactionsImpl.java    |  7 +++-
 .../handlers/cache/GridCacheCommandHandler.java |  1 -
 .../cache/jta/GridCacheJtaManager.java          |  1 +
 18 files changed, 118 insertions(+), 63 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/clients/src/test/java/org/gridgain/client/integration/GridClientAbstractMultiNodeSelfTest.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/gridgain/client/integration/GridClientAbstractMultiNodeSelfTest.java
b/modules/clients/src/test/java/org/gridgain/client/integration/GridClientAbstractMultiNodeSelfTest.java
index 96fb9d6..60ab835 100644
--- a/modules/clients/src/test/java/org/gridgain/client/integration/GridClientAbstractMultiNodeSelfTest.java
+++ b/modules/clients/src/test/java/org/gridgain/client/integration/GridClientAbstractMultiNodeSelfTest.java
@@ -23,7 +23,6 @@ import org.apache.ignite.spi.discovery.tcp.ipfinder.vm.*;
 import org.gridgain.client.*;
 import org.gridgain.client.balancer.*;
 import org.gridgain.client.ssl.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.kernal.*;
 import org.gridgain.grid.kernal.managers.communication.*;
@@ -789,13 +788,13 @@ public abstract class GridClientAbstractMultiNodeSelfTest extends GridCommonAbst
             GridCacheTxEx t = tm.tx(v);
 
             if (t.hasWriteKey(cacheCtx.txKey("x1")))
-                assertFalse(t.syncCommit());
+                assertFalse("Invalid tx flags: " + t, t.syncCommit());
             else if (t.hasWriteKey(cacheCtx.txKey("x2")))
-                assertTrue(t.syncCommit());
+                assertTrue("Invalid tx flags: " + t, t.syncCommit());
             else if (t.hasWriteKey(cacheCtx.txKey("x3")))
-                assertFalse(t.syncCommit());
+                assertFalse("Invalid tx flags: " + t, t.syncCommit());
             else if (t.hasWriteKey(cacheCtx.txKey("x4")))
-                assertTrue(t.syncCommit());
+                assertTrue("Invalid tx flags: " + t, t.syncCommit());
         }
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/clients/src/test/java/org/gridgain/client/suite/GridClientTestSuite.java
----------------------------------------------------------------------
diff --git a/modules/clients/src/test/java/org/gridgain/client/suite/GridClientTestSuite.java
b/modules/clients/src/test/java/org/gridgain/client/suite/GridClientTestSuite.java
index ba503e1..db670e1 100644
--- a/modules/clients/src/test/java/org/gridgain/client/suite/GridClientTestSuite.java
+++ b/modules/clients/src/test/java/org/gridgain/client/suite/GridClientTestSuite.java
@@ -28,10 +28,6 @@ public class GridClientTestSuite extends TestSuite {
     public static TestSuite suite() {
         TestSuite suite = new TestSuite("Gridgain Clients Test Suite");
 
-        // TODO GG-9141
-        if (true)
-            return suite;
-
         suite.addTest(new TestSuite(GridRouterFactorySelfTest.class));
 
         // Parser standalone test.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
index 4d136a1..720ff36 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAdapter.java
@@ -3210,7 +3210,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                             val = (V)ctx.marshalToPortable(val);
                         }
 
-                        GridRawVersionedEntry<K, V> e = new GridRawVersionedEntry<>(key,
null, val, null, ttl, 0, ver);
+                        GridVersionedEntry<K,V> e = new GridRawVersionedEntry<>(key,
null, val, null, ttl, 0, ver);
 
                         e.marshal(ctx.marshaller());
 
@@ -3607,11 +3607,15 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                 READ_COMMITTED,
                 tCfg.getDefaultTxTimeout(),
                 ctx.hasFlag(INVALIDATE),
+                !ctx.hasFlag(SKIP_STORE),
                 0,
                 /** group lock keys */null,
                 /** partition lock */false
             );
 
+            if (ctx.hasFlag(SYNC_COMMIT))
+                tx.syncCommit(true);
+
             assert tx != null;
 
             try {
@@ -3669,7 +3673,7 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
 
         GridCacheTxLocalAdapter<K, V> tx = ctx.tm().threadLocalTx();
 
-        if (tx == null || tx.implicit())
+        if (tx == null || tx.implicit()) {
             tx = ctx.tm().newTx(
                 true,
                 op.single(),
@@ -3677,10 +3681,15 @@ public abstract class GridCacheAdapter<K, V> extends GridMetadataAwareAdapter
im
                 READ_COMMITTED,
                 ctx.kernalContext().config().getTransactionsConfiguration().getDefaultTxTimeout(),
                 ctx.hasFlag(INVALIDATE),
+                !ctx.hasFlag(SKIP_STORE),
                 0,
                 null,
                 false);
 
+            if (ctx.hasFlag(SYNC_COMMIT))
+                tx.syncCommit(true);
+        }
+
         return asyncOp(tx, op);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
index 84045a2..7a32afa 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxAdapter.java
@@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.cache;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.lang.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.kernal.processors.cache.distributed.near.*;
 import org.gridgain.grid.util.*;
@@ -188,7 +187,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
     protected String taskName;
 
     /** Store used flag. */
-    protected boolean storeUsed;
+    protected boolean storeEnabled = true;
 
     /**
      * Empty constructor required for {@link Externalizable}.
@@ -219,6 +218,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
         GridCacheTxIsolation isolation,
         long timeout,
         boolean invalidate,
+        boolean storeEnabled,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         @Nullable UUID subjId,
@@ -236,6 +236,7 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
         this.isolation = isolation;
         this.timeout = timeout;
         this.invalidate = invalidate;
+        this.storeEnabled = storeEnabled;
         this.txSize = txSize;
         this.grpLockKey = grpLockKey;
         this.subjId = subjId;
@@ -381,8 +382,37 @@ public abstract class GridCacheTxAdapter<K, V> extends GridMetadataAwareAdapter
     }
 
     /** {@inheritDoc} */
+    @Override public boolean storeEnabled() {
+        return storeEnabled;
+    }
+
+    /**
+     * @param storeEnabled Store enabled flag.
+     */
+    public void storeEnabled(boolean storeEnabled) {
+        this.storeEnabled = storeEnabled;
+    }
+
+    /** {@inheritDoc} */
     @Override public boolean storeUsed() {
-        return storeUsed;
+        return storeEnabled() && store() != null;
+    }
+
+    /**
+     * Store manager for current transaction.
+     *
+     * @return Store manager.
+     */
+    protected GridCacheStoreManager<K, V> store() {
+        if (!activeCacheIds().isEmpty()) {
+            int cacheId = F.first(activeCacheIds());
+
+            GridCacheStoreManager<K, V> store = cctx.cacheContext(cacheId).store();
+
+            return store.configured() ? store : null;
+        }
+
+        return null;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java
index f1c22ea..877c0f1 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxEx.java
@@ -43,7 +43,13 @@ public interface GridCacheTxEx<K, V> extends GridCacheTx, GridTimeoutObject
{
     public int size();
 
     /**
-     * @return {@code True} if transaction involves caches with cache store configured.
+     * @return {@code True} if transaction is allowed to use store.
+     */
+    public boolean storeEnabled();
+
+    /**
+     * @return {@code True} if transaction is allowed to use store and transactions spans
one or more caches with
+     *      store enabled.
      */
     public boolean storeUsed();
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
index e629d3f..fa85566 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxHandler.java
@@ -524,7 +524,9 @@ public class GridCacheTxHandler<K, V> {
                     return null;
                 }
 
-                tx.syncCommit(req.syncCommit());
+                if (!tx.syncCommit())
+                    tx.syncCommit(req.syncCommit());
+
                 tx.nearFinishFutureId(req.futureId());
                 tx.nearFinishMiniId(req.miniId());
                 tx.recoveryWrites(req.recoveryWrites());

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
index 2c52e0a..b7fa4b2 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxLocalAdapter.java
@@ -110,6 +110,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
         GridCacheTxIsolation isolation,
         long timeout,
         boolean invalidate,
+        boolean storeEnabled,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
@@ -117,7 +118,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
         int taskNameHash
     ) {
         super(cctx, xidVer, implicit, implicitSingle, /*local*/true, concurrency, isolation,
timeout, invalidate,
-            txSize, grpLockKey, subjId, taskNameHash);
+            storeEnabled, txSize, grpLockKey, subjId, taskNameHash);
 
         assert !partLock || grpLockKey != null;
 
@@ -423,23 +424,6 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
     }
 
     /**
-     * Store manager for current transaction.
-     *
-     * @return Store manager.
-     */
-    protected GridCacheStoreManager<K, V> store() {
-        if (!activeCacheIds.isEmpty()) {
-            int cacheId = F.first(activeCacheIds);
-
-            GridCacheStoreManager<K, V> store = cctx.cacheContext(cacheId).store();
-
-            return store.configured() ? store : null;
-        }
-
-        return null;
-    }
-
-    /**
      * Performs batch database operations. This commit must be called
      * before {@link #userCommit()}. This way if there is a DB failure,
      * cache transaction can still be rolled back.
@@ -451,7 +435,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
     protected void batchStoreCommit(Iterable<GridCacheTxEntry<K, V>> writeEntries)
throws IgniteCheckedException {
         GridCacheStoreManager<K, V> store = store();
 
-        if (store != null && (!internal() || groupLock())) {
+        if (store != null && storeEnabled() && (!internal() || groupLock()))
{
             try {
                 // Implicit transactions are always updated at the end.
                 if (isBatchUpdate()) {
@@ -985,7 +969,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
 
     /**
      * Checks if there is a cached or swapped value for
-     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, org.apache.ignite.lang.IgnitePredicate[])}
method.
+     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, IgnitePredicate[])}
method.
      *
      *
      * @param keys Key to enlist.
@@ -1232,7 +1216,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
 
     /**
      * Loads all missed keys for
-     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, org.apache.ignite.lang.IgnitePredicate[])}
method.
+     * {@link #getAllAsync(GridCacheContext, Collection, GridCacheEntryEx, boolean, IgnitePredicate[])}
method.
      *
      * @param map Return map.
      * @param missedMap Missed keys.
@@ -2541,7 +2525,8 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                             ", part=" + part + ", groupLockKey=" + grpLockKey + ']');
                 }
                 else {
-                    GridCacheTxKey affinityKey = cacheCtx.txKey((K)cacheCtx.config().getAffinityMapper().affinityKey(key));
+                    GridCacheTxKey affinityKey = cacheCtx.txKey(
+                        (K)cacheCtx.config().getAffinityMapper().affinityKey(key));
 
                     if (!grpLockKey.equals(affinityKey))
                         throw new IgniteCheckedException("Failed to enlist key into group-lock
transaction (affinity key was " +

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
index 7179f8e..935ae1d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheTxManager.java
@@ -365,6 +365,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
         GridCacheTxIsolation isolation,
         long timeout,
         boolean invalidate,
+        boolean storeEnabled,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock) {
@@ -380,6 +381,7 @@ public class GridCacheTxManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
             isolation,
             timeout,
             invalidate,
+            storeEnabled,
             txSize,
             grpLockKey,
             partLock,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
index 69500dd..3f30801 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTransactionalCacheAdapter.java
@@ -768,6 +768,8 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends
GridDhtCach
                                     req.subjectId(),
                                     req.taskNameHash());
 
+                                tx.syncCommit(req.syncCommit());
+
                                 tx = ctx.tm().onCreated(tx);
 
                                 if (tx == null || !tx.init()) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
index 95cd4ad..461ea04 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/GridDhtTxLocalAdapter.java
@@ -52,9 +52,6 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
     private long dhtThreadId;
 
     /** */
-    private boolean explicitLock;
-
-    /** */
     private boolean needsCompletedVers;
 
     /** Versions of pending locks for entries of this tx. */
@@ -75,7 +72,6 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
      * @param concurrency Concurrency.
      * @param isolation Isolation.
      * @param timeout Timeout.
-     * @param explicitLock Explicit lock flag.
      * @param txSize Expected transaction size.
      * @param grpLockKey Group lock key if this is a group-lock transaction.
      * @param partLock If this is a group-lock transaction and the whole partition should
be locked.
@@ -89,20 +85,18 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
         GridCacheTxIsolation isolation,
         long timeout,
         boolean invalidate,
-        boolean explicitLock,
+        boolean storeEnabled,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
         @Nullable UUID subjId,
         int taskNameHash
     ) {
-        super(cctx, xidVer, implicit, implicitSingle, concurrency, isolation, timeout, invalidate,
txSize, grpLockKey,
-            partLock, subjId, taskNameHash);
+        super(cctx, xidVer, implicit, implicitSingle, concurrency, isolation, timeout, invalidate,
storeEnabled, txSize,
+            grpLockKey, partLock, subjId, taskNameHash);
 
         assert cctx != null;
 
-        this.explicitLock = explicitLock;
-
         threadId = Thread.currentThread().getId();
         dhtThreadId = threadId;
     }
@@ -166,13 +160,6 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
     }
 
     /**
-     * @return Explicit lock flag.
-     */
-    boolean explicitLock() {
-        return explicitLock;
-    }
-
-    /**
      * @return DHT thread ID.
      */
     long dhtThreadId() {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
index d27ee3d..535f46e 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/colocated/GridDhtColocatedLockFuture.java
@@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.cache.distributed.dht.colocated;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.lang.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.kernal.managers.discovery.*;
 import org.gridgain.grid.kernal.processors.cache.*;
@@ -704,6 +703,7 @@ public final class GridDhtColocatedLockFuture<K, V> extends GridCompoundIdentity
                                         timeout,
                                         mappedKeys.size(),
                                         inTx() ? tx.size() : mappedKeys.size(),
+                                        inTx() && tx.syncCommit(),
                                         inTx() ? tx.groupLockKey() : null,
                                         inTx() && tx.partitionLock(),
                                         inTx() ? tx.subjectId() : null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockFuture.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockFuture.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockFuture.java
index 15f9a85..b67229d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockFuture.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockFuture.java
@@ -12,7 +12,6 @@ package org.gridgain.grid.kernal.processors.cache.distributed.near;
 import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.lang.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.kernal.managers.discovery.*;
 import org.gridgain.grid.kernal.processors.cache.*;
@@ -846,6 +845,7 @@ public final class GridNearLockFuture<K, V> extends GridCompoundIdentityFuture<B
                                             timeout,
                                             mappedKeys.size(),
                                             inTx() ? tx.size() : mappedKeys.size(),
+                                            inTx() && tx.syncCommit(),
                                             inTx() ? tx.groupLockKey() : null,
                                             inTx() && tx.partitionLock(),
                                             inTx() ? tx.subjectId() : null,

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
index d9217d5..abcc189 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearLockRequest.java
@@ -69,6 +69,9 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
     @GridDirectVersion(3)
     private boolean hasTransforms;
 
+    /** Sync commit flag. */
+    private boolean syncCommit;
+
     /**
      * Empty constructor required for {@link Externalizable}.
      */
@@ -110,6 +113,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
         long timeout,
         int keyCnt,
         int txSize,
+        boolean syncCommit,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
         @Nullable UUID subjId,
@@ -137,6 +141,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
         this.topVer = topVer;
         this.implicitTx = implicitTx;
         this.implicitSingleTx = implicitSingleTx;
+        this.syncCommit = syncCommit;
         this.subjId = subjId;
         this.taskNameHash = taskNameHash;
 
@@ -193,6 +198,13 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
     }
 
     /**
+     * @return Sync commit flag.
+     */
+    public boolean syncCommit() {
+        return syncCommit;
+    }
+
+    /**
      * @return Filter.
      */
     public IgnitePredicate<GridCacheEntry<K, V>>[] filter() {
@@ -316,6 +328,7 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
         _clone.subjId = subjId;
         _clone.taskNameHash = taskNameHash;
         _clone.hasTransforms = hasTransforms;
+        _clone.syncCommit = syncCommit;
     }
 
     /** {@inheritDoc} */
@@ -436,6 +449,11 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
 
                 commState.idx++;
 
+            case 34:
+                if (!commState.putBoolean(syncCommit))
+                    return false;
+
+                commState.idx++;
         }
 
         return true;
@@ -576,6 +594,13 @@ public class GridNearLockRequest<K, V> extends GridDistributedLockRequest<K,
V>
 
                 commState.idx++;
 
+            case 34:
+                if (buf.remaining() < 1)
+                    return false;
+
+                syncCommit = commState.getBoolean();
+
+                commState.idx++;
         }
 
         return true;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
index 5ff258f..2b974e9 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/near/GridNearTxLocal.java
@@ -96,6 +96,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
         GridCacheTxIsolation isolation,
         long timeout,
         boolean invalidate,
+        boolean storeEnabled,
         int txSize,
         @Nullable GridCacheTxKey grpLockKey,
         boolean partLock,
@@ -111,7 +112,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
             isolation,
             timeout,
             invalidate,
-            /*TODO explicit lock???*/false,
+            storeEnabled,
             txSize,
             grpLockKey,
             partLock,
@@ -191,6 +192,9 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
      * @return {@code True} if transaction is fully synchronous.
      */
     private boolean sync() {
+        if (super.syncCommit())
+            return true;
+
         for (int cacheId : activeCacheIds()) {
             if (cctx.cacheContext(cacheId).config().getWriteSynchronizationMode() == FULL_SYNC)
                 return true;
@@ -280,9 +284,7 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
                 }
             });
         }
-        else {
-            assert cacheCtx.isColocated();
-
+        else if (cacheCtx.isColocated()) {
             return cacheCtx.colocated().loadAsync(keys, /*reload*/false, /*force primary*/false,
topologyVersion(),
                 CU.subjectId(this, cctx), resolveTaskName(), deserializePortable, null)
                 .chain(new C1<IgniteFuture<Map<K, V>>, Boolean>() {
@@ -305,6 +307,11 @@ public class GridNearTxLocal<K, V> extends GridDhtTxLocalAdapter<K,
V> {
                     }
                 });
         }
+        else {
+            assert cacheCtx.isLocal();
+
+            return super.loadMissing(cacheCtx, async, keys, deserializePortable, c);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
index e769893..cebd888 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/local/GridLocalTx.java
@@ -60,7 +60,7 @@ class GridLocalTx<K, V> extends GridCacheTxLocalAdapter<K, V>
{
         @Nullable UUID subjId,
         int taskNameHash
     ) {
-        super(ctx, ctx.versions().next(), implicit, implicitSingle, concurrency, isolation,
timeout, false, txSize,
+        super(ctx, ctx.versions().next(), implicit, implicitSingle, concurrency, isolation,
timeout, false, true, txSize,
             null, false, subjId, taskNameHash);
     }
 

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
index a8e1344..98a87e3 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/transactions/IgniteTransactionsImpl.java
@@ -106,6 +106,7 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactions
{
             isolation,
             timeout,
             false,
+            true,
             txSize,
             /** group lock keys */null,
             /** partition lock */false
@@ -168,13 +169,14 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactions
{
             throw new IllegalStateException("Failed to start new transaction " +
                 "(current thread already has a transaction): " + tx);
 
-        GridCacheTxLocalEx<K, V> tx0 = cctx.tm().newTx(
+        GridCacheTxLocalAdapter<K, V> tx0 = cctx.tm().newTx(
             false,
             false,
             concurrency,
             isolation,
             timeout,
             ctx.hasFlag(INVALIDATE),
+            !ctx.hasFlag(SKIP_STORE),
             txSize,
             ctx.txKey(grpLockKey),
             partLock
@@ -182,6 +184,9 @@ public class IgniteTransactionsImpl<K, V> implements IgniteTransactions
{
 
         assert tx0 != null;
 
+        if (ctx.hasFlag(SYNC_COMMIT))
+            tx0.syncCommit(true);
+
         IgniteFuture<?> lockFut = tx0.groupLockAsync(ctx, (Collection)F.asList(grpLockKey));
 
         try {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/cache/GridCacheCommandHandler.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/cache/GridCacheCommandHandler.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/cache/GridCacheCommandHandler.java
index 1bab28a..1a68cc7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/cache/GridCacheCommandHandler.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/rest/handlers/cache/GridCacheCommandHandler.java
@@ -13,7 +13,6 @@ import org.apache.ignite.*;
 import org.apache.ignite.cluster.*;
 import org.apache.ignite.lang.*;
 import org.apache.ignite.resources.*;
-import org.gridgain.grid.*;
 import org.gridgain.grid.cache.*;
 import org.gridgain.grid.cache.datastructures.*;
 import org.gridgain.grid.kernal.*;

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/0cb0c334/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
----------------------------------------------------------------------
diff --git a/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
b/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
index 79f439a..6044900 100644
--- a/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
+++ b/modules/jta/src/main/java/org/gridgain/grid/kernal/processors/cache/jta/GridCacheJtaManager.java
@@ -70,6 +70,7 @@ public class GridCacheJtaManager<K, V> extends GridCacheJtaManagerAdapter<K,
V>
                                 tCfg.getDefaultTxIsolation(),
                                 tCfg.getDefaultTxTimeout(),
                                 false,
+                                true,
                                 0,
                                 /** group lock keys */null,
                                 /** partition lock */false


Mime
View raw message