ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [22/38] incubator-ignite git commit: # ignite-41
Date Tue, 23 Dec 2014 08:22:58 GMT
# ignite-41


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

Branch: refs/heads/ignite-1
Commit: afe0d03704b5c6badd38f41558765c1e824c3c2e
Parents: 5731d59
Author: sboikov <semen.boikov@inria.fr>
Authored: Sun Dec 21 22:49:18 2014 +0300
Committer: sboikov <semen.boikov@inria.fr>
Committed: Sun Dec 21 23:14:53 2014 +0300

----------------------------------------------------------------------
 .../processors/cache/IgniteCacheProxy.java      |  9 ++++-
 .../cache/GridCacheAccessExpiryPolicy.java      |  3 +-
 .../processors/cache/GridCacheEntryEx.java      |  2 +-
 .../processors/cache/GridCacheIoManager.java    |  2 --
 .../processors/cache/GridCacheMapEntry.java     | 30 +++-------------
 .../cache/GridCacheTxLocalAdapter.java          | 38 ++++++++++++++++++--
 .../kernal/processors/cache/GridCacheUtils.java | 23 ++++++++++++
 .../GridDistributedTxRemoteAdapter.java         | 13 ++++++-
 .../dht/GridDhtTransactionalCacheAdapter.java   |  2 +-
 .../distributed/dht/GridDhtTxLocalAdapter.java  |  2 +-
 .../dht/atomic/GridDhtAtomicCache.java          |  6 ++--
 .../IgniteCacheExpiryPolicyAbstractTest.java    | 27 ++++++++++++++
 .../GridCacheBasicOpAbstractTest.java           |  4 +--
 13 files changed, 119 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
index 01133b9..8bcd6a9 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/IgniteCacheProxy.java
@@ -235,7 +235,14 @@ public class IgniteCacheProxy<K, V> implements IgniteCache<K,
V>, Externalizable
     /** {@inheritDoc} */
     @Override public int localSize(CachePeekMode... peekModes) {
         // TODO IGNITE-1.
-        throw new UnsupportedOperationException();
+        GridCacheProjectionImpl<K, V> prev = gate.enter(prj);
+
+        try {
+            return delegate.size();
+        }
+        finally {
+            gate.leave(prev);
+        }
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAccessExpiryPolicy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAccessExpiryPolicy.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAccessExpiryPolicy.java
index ebac13c..4f30a95 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAccessExpiryPolicy.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheAccessExpiryPolicy.java
@@ -11,7 +11,6 @@ package org.gridgain.grid.kernal.processors.cache;
 
 import org.apache.ignite.lang.*;
 import org.gridgain.grid.util.typedef.internal.*;
-import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
 import javax.cache.expiry.*;
@@ -43,7 +42,7 @@ public class GridCacheAccessExpiryPolicy implements GridCacheExpiryPolicy
{
         if (duration == null)
             return null;
 
-        return new GridCacheAccessExpiryPolicy(GridCacheMapEntry.toTtl(duration));
+        return new GridCacheAccessExpiryPolicy(GridCacheUtils.toTtl(duration));
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryEx.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryEx.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryEx.java
index b684183..987b1c7 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryEx.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheEntryEx.java
@@ -876,7 +876,7 @@ public interface GridCacheEntryEx<K, V> extends GridMetadataAware
{
      * @param ver Version.
      * @param ttl Time to live.
      */
-    public void updateTtl(GridCacheVersion ver, long ttl);
+    public void updateTtl(@Nullable GridCacheVersion ver, long ttl);
 
     /**
      * @return Value.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheIoManager.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheIoManager.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheIoManager.java
index 969d28f..92cdb9a 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheIoManager.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheIoManager.java
@@ -193,8 +193,6 @@ public class GridCacheIoManager<K, V> extends GridCacheSharedManagerAdapter<K,
V
 
             unmarshall(nodeId, cacheMsg);
 
-            //log.info("Message: " + cacheMsg);
-
             if (cacheMsg.allowForStartup())
                 processMessage(nodeId, cacheMsg, c);
             else {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
index 7944509..1d81a1c 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheMapEntry.java
@@ -1519,7 +1519,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
 
                 if (!pass) {
                     if (expiryPlc != null && hasValueUnlocked()) {
-                        long ttl = toTtl(expiryPlc.getExpiryForAccess());
+                        long ttl = GridCacheUtils.toTtl(expiryPlc.getExpiryForAccess());
 
                         if (ttl != -1L)
                             updateTtl(ttl);
@@ -1583,7 +1583,7 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
                 long expireTime;
 
                 if (expiryPlc != null) {
-                    ttl = toTtl(hadVal ? expiryPlc.getExpiryForUpdate() : expiryPlc.getExpiryForCreation());
+                    ttl = GridCacheUtils.toTtl(hadVal ? expiryPlc.getExpiryForUpdate() :
expiryPlc.getExpiryForCreation());
 
                     if (ttl == -1L) {
                         ttl = ttlExtras();
@@ -1676,28 +1676,6 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
         return new IgniteBiTuple<>(res, cctx.<V>unwrapTemporary(interceptorRes
!= null ? interceptorRes.get2() : old));
     }
 
-    /**
-     * @param duration Duration.
-     * @return TTL.
-     */
-    public static long toTtl(Duration duration) {
-        if (duration == null)
-            return -1;
-
-        if (duration.getDurationAmount() == 0) {
-            if (duration.isEternal())
-                return 0;
-
-            assert duration.isZero();
-
-            return 1L;
-        }
-
-        assert duration.getTimeUnit() != null;
-
-        return duration.getTimeUnit().toMillis(duration.getDurationAmount());
-    }
-
     /** {@inheritDoc} */
     @Override public GridCacheUpdateAtomicResult<K, V> innerUpdate(
         GridCacheVersion newVer,
@@ -3426,14 +3404,14 @@ public abstract class GridCacheMapEntry<K, V> implements GridCacheEntryEx<K,
V>
     }
 
     /** {@inheritDoc} */
-    @Override public void updateTtl(GridCacheVersion ver, long ttl) {
+    @Override public void updateTtl(@Nullable GridCacheVersion ver, long ttl) {
         synchronized (this) {
             updateTtl(ttl);
 
             /*
             TODO IGNITE-41.
             try {
-                if (ver.equals(version()))
+                if (var == null || ver.equals(version()))
                     updateTtl(ttl);
             }
             catch (GridCacheEntryRemovedException ignored) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/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 3a5e604..f1fdce1 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
@@ -666,7 +666,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                                             Duration duration = cached.hasValue() ?
                                                 expiry.getExpiryForUpdate() : expiry.getExpiryForCreation();
 
-                                            txEntry.ttl(GridCacheMapEntry.toTtl(duration));
+                                            txEntry.ttl(GridCacheUtils.toTtl(duration));
                                         }
                                     }
 
@@ -782,6 +782,11 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                                             nearCached.innerReload(CU.<K, V>empty());
                                     }
                                     else if (op == READ) {
+                                        Duration duration = expiryForAccess(txEntry);
+
+                                        if (duration != null)
+                                            cached.updateTtl(null, GridCacheUtils.toTtl(duration));
+
                                         if (log.isDebugEnabled())
                                             log.debug("Ignoring READ entry when committing:
" + txEntry);
                                     }
@@ -857,12 +862,28 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                         }
                     }
                 }
+
+                if (!near()) {
+                    for (GridCacheTxEntry<K, V> txEntry : readEntries()) {
+                        Duration duration = expiryForAccess(txEntry);
+
+                        if (duration != null)
+                            txEntry.cached().updateTtl(null, GridCacheUtils.toTtl(duration));
+                    }
+                }
             }
             finally {
                 cctx.tm().txContextReset();
             }
         }
         else {
+            for (GridCacheTxEntry<K, V> txEntry : readEntries()) {
+                Duration duration = expiryForAccess(txEntry);
+
+                if (duration != null)
+                    txEntry.cached().updateTtl(null, GridCacheUtils.toTtl(duration));
+            }
+
             GridCacheStoreManager<K, V> store = store();
 
             if (store != null && (!internal() || groupLock())) {
@@ -897,6 +918,19 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
     }
 
     /**
+     * @param txEntry Tx entry.
+     * @return New duration.
+     */
+    @Nullable private Duration expiryForAccess(GridCacheTxEntry<K, V> txEntry) {
+        ExpiryPolicy expiry = txEntry.expiry();
+
+        if (expiry == null)
+            expiry = txEntry.context().expiry();
+
+        return expiry != null ? expiry.getExpiryForAccess() : null;
+    }
+
+    /**
      * Commits transaction to transaction manager. Used for one-phase commit transactions
only.
      */
     public void tmCommit() {
@@ -2110,7 +2144,7 @@ public abstract class GridCacheTxLocalAdapter<K, V> extends GridCacheTxAdapter<K
                         ExpiryPolicy expiryPlc = txEntry.expiry() != null ? txEntry.expiry()
: cacheCtx.expiry();
 
                         if (expiryPlc != null)
-                            txEntry.ttl(GridCacheMapEntry.toTtl(expiryPlc.getExpiryForAccess()));
+                            txEntry.ttl(GridCacheUtils.toTtl(expiryPlc.getExpiryForAccess()));
                     }
 
                     break; // While.

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheUtils.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheUtils.java
index aac525e..248695d 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/GridCacheUtils.java
@@ -24,6 +24,7 @@ import org.gridgain.grid.util.typedef.internal.*;
 import org.jdk8.backport.*;
 import org.jetbrains.annotations.*;
 
+import javax.cache.expiry.*;
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.*;
@@ -1646,4 +1647,26 @@ public class GridCacheUtils {
     public static <K, V> boolean invalidate(GridCacheProjection<K, V> cache,
K key) {
         return cache.clear(key);
     }
+
+    /**
+     * @param duration Duration.
+     * @return TTL.
+     */
+    public static long toTtl(Duration duration) {
+        if (duration == null)
+            return -1;
+
+        if (duration.getDurationAmount() == 0) {
+            if (duration.isEternal())
+                return 0;
+
+            assert duration.isZero();
+
+            return 1L;
+        }
+
+        assert duration.getTimeUnit() != null;
+
+        return duration.getTimeUnit().toMillis(duration.getDurationAmount());
+    }
 }

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
index df6fc49..39e9ccc 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/GridDistributedTxRemoteAdapter.java
@@ -21,6 +21,7 @@ import org.gridgain.grid.util.typedef.*;
 import org.gridgain.grid.util.typedef.internal.*;
 import org.jetbrains.annotations.*;
 
+import javax.cache.expiry.*;
 import java.io.*;
 import java.util.*;
 import java.util.concurrent.atomic.*;
@@ -575,7 +576,17 @@ public class GridDistributedTxRemoteAdapter<K, V> extends GridCacheTxAdapter<K,
                                         }
                                     }
                                     else if (op == READ) {
-                                        assert near();
+                                        ExpiryPolicy expiry = txEntry.expiry();
+
+                                        if (expiry == null)
+                                            expiry = cacheCtx.expiry();
+
+                                        if (expiry != null) {
+                                            Duration duration = expiry.getExpiryForAccess();
+
+                                            if (duration != null)
+                                                cached.updateTtl(null, GridCacheUtils.toTtl(duration));
+                                        }
 
                                         if (log.isDebugEnabled())
                                             log.debug("Ignoring READ entry when committing:
" + txEntry);

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/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 393d13c..b608525 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
@@ -208,7 +208,7 @@ public abstract class GridDhtTransactionalCacheAdapter<K, V> extends
GridDhtCach
 
                             tx.addWrite(
                                 ctx,
-                                writeEntry == null ? NOOP : writeEntry.op(),
+                                writeEntry == null ? (req.txRead() ? READ : NOOP) : writeEntry.op(),
                                 txKey,
                                 req.keyBytes() != null ? req.keyBytes().get(i) : null,
                                 writeEntry == null ? null : writeEntry.value(),

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/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 d33a317..4fcedca 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
@@ -514,7 +514,7 @@ public abstract class GridDhtTxLocalAdapter<K, V> extends GridCacheTxLocalAdapte
 
                     GridCacheTxEntry<K, V> w = writeEntries == null ? null : writeEntries.get(idx++);
 
-                    txEntry = addEntry(NOOP, null, null, cached, null, CU.<K, V>empty(),
false, -1L, -1L,
+                    txEntry = addEntry(read ? READ : NOOP, null, null, cached, null, CU.<K,
V>empty(), false, -1L, -1L,
                         drVers != null ? drVers[drVerIdx++] : null);
 
                     if (w != null) {

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
index 334ecb0..4dad072 100644
--- a/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
+++ b/modules/core/src/main/java/org/gridgain/grid/kernal/processors/cache/distributed/dht/atomic/GridDhtAtomicCache.java
@@ -2723,17 +2723,17 @@ public class GridDhtAtomicCache<K, V> extends GridDhtCacheAdapter<K,
V> {
 
         /** {@inheritDoc} */
         @Override public long forCreate() {
-            return GridCacheMapEntry.toTtl(plc.getExpiryForCreation());
+            return toTtl(plc.getExpiryForCreation());
         }
 
         /** {@inheritDoc} */
         @Override public long forUpdate() {
-            return GridCacheMapEntry.toTtl(plc.getExpiryForUpdate());
+            return toTtl(plc.getExpiryForUpdate());
         }
 
         /** {@inheritDoc} */
         @Override public long forAccess() {
-            return GridCacheMapEntry.toTtl(plc.getExpiryForAccess());
+            return toTtl(plc.getExpiryForAccess());
         }
 
         /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
index 2d115c6..adaee5d 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/expiry/IgniteCacheExpiryPolicyAbstractTest.java
@@ -157,6 +157,33 @@ public abstract class IgniteCacheExpiryPolicyAbstractTest extends IgniteCacheAbs
 
             filterAccessReplace(key);
         }
+
+        if (atomicityMode() == TRANSACTIONAL) {
+            for (final Integer key : keys()) {
+                log.info("Test txGet [key=" + key + ']');
+
+                txGet(key);
+            }
+        }
+    }
+
+    /**
+     * @throws Exception If failed.
+     */
+    private void txGet(Integer key) throws Exception {
+        IgniteCache<Integer, Integer> cache = jcache();
+
+        cache.put(key, 1);
+
+        checkTtl(key, 60_000L);
+
+        try (GridCacheTx tx = ignite(0).transactions().txStart()) {
+            assertEquals((Integer)1, cache.get(key));
+
+            tx.commit();
+        }
+
+        checkTtl(key, 62_000L, true);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/afe0d037/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheBasicOpAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheBasicOpAbstractTest.java
b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheBasicOpAbstractTest.java
index bd473eb..7887e1c 100644
--- a/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheBasicOpAbstractTest.java
+++ b/modules/core/src/test/java/org/gridgain/grid/kernal/processors/cache/distributed/GridCacheBasicOpAbstractTest.java
@@ -317,10 +317,10 @@ public abstract class GridCacheBasicOpAbstractTest extends GridCommonAbstractTes
         IgniteCache<String, String> cache2 = ignite2.jcache(null);
         IgniteCache<String, String> cache3 = ignite3.jcache(null);
 
-        GridCacheTx tx = ignite1.transactions().txStart();
-
         cache1.put("key", "val");
 
+        GridCacheTx tx = ignite1.transactions().txStart();
+
         long ttl = 500;
 
         cache1.withExpiryPolicy(new TouchedExpiryPolicy(new Duration(TimeUnit.MILLISECONDS,
ttl))).put("key", "val");


Mime
View raw message