ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sboi...@apache.org
Subject [50/50] [abbrv] ignite git commit: ignite-2893
Date Thu, 06 Apr 2017 13:31:57 GMT
ignite-2893


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

Branch: refs/heads/ignite-2893
Commit: 1e18640391c01bcf238c159321543307bcb43786
Parents: b2c87cb
Author: sboikov <sboikov@gridgain.com>
Authored: Thu Apr 6 15:18:38 2017 +0300
Committer: sboikov <sboikov@gridgain.com>
Committed: Thu Apr 6 16:30:27 2017 +0300

----------------------------------------------------------------------
 .../processors/cache/GridCacheUtils.java        | 114 +++-----
 .../datastructures/DataStructuresProcessor.java |  55 +---
 .../datastructures/GridCacheAtomicLongImpl.java |   8 +-
 .../GridCacheAtomicReferenceImpl.java           | 268 ++++++++++-------
 .../GridCacheAtomicSequenceImpl.java            |  88 +-----
 .../GridCacheAtomicStampedImpl.java             | 287 +++++++++---------
 .../GridCacheCountDownLatchImpl.java            |  56 ++--
 .../datastructures/GridCacheLockImpl.java       |  69 ++---
 .../datastructures/GridCacheQueueProxy.java     | 292 +------------------
 .../datastructures/GridCacheSemaphoreImpl.java  |  52 ++--
 .../datastructures/GridCacheSetProxy.java       | 152 +---------
 .../GridTransactionalCacheQueueImpl.java        |   8 +-
 12 files changed, 445 insertions(+), 1004 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
index bce054a..05330d2 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheUtils.java
@@ -848,31 +848,6 @@ public class GridCacheUtils {
     }
 
     /**
-     * Method executes any Callable out of scope of transaction.
-     * If transaction started by this thread {@code cmd} will be executed in another thread.
-     *
-     * @param cmd Callable.
-     * @param ctx Cache context.
-     * @return T Callable result.
-     * @throws IgniteCheckedException If execution failed.
-     */
-    public static <T> T outTx(Callable<T> cmd, GridCacheContext ctx) throws IgniteCheckedException {
-        if (ctx.tm().inUserTx())
-            return ctx.closures().callLocalSafe(cmd, false).get();
-        else {
-            try {
-                return cmd.call();
-            }
-            catch (IgniteCheckedException | IgniteException | IllegalStateException e) {
-                throw e;
-            }
-            catch (Exception e) {
-                throw new IgniteCheckedException(e);
-            }
-        }
-    }
-
-    /**
      * @param val Value.
      * @param skip Skip value flag.
      * @return Value.
@@ -1585,56 +1560,55 @@ public class GridCacheUtils {
 
     /**
      * @param c Closure to retry.
-     * @param <S> Closure type.
-     * @return Wrapped closure.
-     */
-    public static <S> Callable<S> retryTopologySafe(final Callable<S> c ) {
-        return new Callable<S>() {
-            @Override public S call() throws Exception {
-                IgniteCheckedException err = null;
-
-                for (int i = 0; i < GridCacheAdapter.MAX_RETRIES; i++) {
-                    try {
-                        return c.call();
-                    }
-                    catch (ClusterGroupEmptyCheckedException | ClusterTopologyServerNotFoundException e) {
+     * @throws IgniteCheckedException If failed.
+     * @return Closure result.
+     */
+    public static <S> S retryTopologySafe(final Callable<S> c) throws IgniteCheckedException {
+        IgniteCheckedException err = null;
+
+        for (int i = 0; i < GridCacheAdapter.MAX_RETRIES; i++) {
+            try {
+                return c.call();
+            }
+            catch (ClusterGroupEmptyCheckedException | ClusterTopologyServerNotFoundException e) {
+                throw e;
+            }
+            catch (TransactionRollbackException e) {
+                if (i + 1 == GridCacheAdapter.MAX_RETRIES)
+                    throw e;
+
+                U.sleep(1);
+            }
+            catch (IgniteCheckedException e) {
+                if (i + 1 == GridCacheAdapter.MAX_RETRIES)
+                    throw e;
+
+                if (X.hasCause(e, ClusterTopologyCheckedException.class)) {
+                    ClusterTopologyCheckedException topErr = e.getCause(ClusterTopologyCheckedException.class);
+
+                    if (topErr instanceof ClusterGroupEmptyCheckedException || topErr instanceof
+                        ClusterTopologyServerNotFoundException)
                         throw e;
-                    }
-                    catch (TransactionRollbackException e) {
-                        if (i + 1 == GridCacheAdapter.MAX_RETRIES)
-                            throw e;
 
+                    // IGNITE-1948: remove this check when the issue is fixed
+                    if (topErr.retryReadyFuture() != null)
+                        topErr.retryReadyFuture().get();
+                    else
                         U.sleep(1);
-                    }
-                    catch (IgniteCheckedException e) {
-                        if (i + 1 == GridCacheAdapter.MAX_RETRIES)
-                            throw e;
-
-                        if (X.hasCause(e, ClusterTopologyCheckedException.class)) {
-                            ClusterTopologyCheckedException topErr = e.getCause(ClusterTopologyCheckedException.class);
-
-                            if (topErr instanceof ClusterGroupEmptyCheckedException || topErr instanceof
-                                ClusterTopologyServerNotFoundException)
-                                throw e;
-
-                            // IGNITE-1948: remove this check when the issue is fixed
-                            if (topErr.retryReadyFuture() != null)
-                                topErr.retryReadyFuture().get();
-                            else
-                                U.sleep(1);
-                        }
-                        else if (X.hasCause(e, IgniteTxRollbackCheckedException.class,
-                            CachePartialUpdateCheckedException.class))
-                            U.sleep(1);
-                        else
-                            throw e;
-                    }
                 }
-
-                // Should never happen.
-                throw err;
+                else if (X.hasCause(e, IgniteTxRollbackCheckedException.class,
+                    CachePartialUpdateCheckedException.class))
+                    U.sleep(1);
+                else
+                    throw e;
             }
-        };
+            catch (Exception e) {
+                throw new IgniteCheckedException(e);
+            }
+        }
+
+        // Should never happen.
+        throw err;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
index 0420182..59edf62 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java
@@ -419,7 +419,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
      * @param name Sequence name.
      * @throws IgniteCheckedException If removing failed.
      */
-    public final void removeSequence(final String name) throws IgniteCheckedException {
+    final void removeSequence(final String name) throws IgniteCheckedException {
         assert name != null;
 
         awaitInitialization();
@@ -431,9 +431,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
                 dsCacheCtx.gate().enter();
 
                 try {
-                    GridCacheInternal key = new GridCacheInternalKeyImpl(name);
-
-                    removeInternal(key, GridCacheAtomicSequenceValue.class);
+                    dsView.remove(new GridCacheInternalKeyImpl(name));
                 }
                 finally {
                     dsCacheCtx.gate().leave();
@@ -585,7 +583,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
                 dsCacheCtx.gate().enter();
 
                 try {
-                    removeInternal(new GridCacheInternalKeyImpl(name), GridCacheAtomicLongValue.class);
+                    dsView.remove(new GridCacheInternalKeyImpl(name));
                 }
                 finally {
                     dsCacheCtx.gate().leave();
@@ -744,9 +742,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
                 dsCacheCtx.gate().enter();
 
                 try {
-                    GridCacheInternal key = new GridCacheInternalKeyImpl(name);
-
-                    removeInternal(key, GridCacheAtomicReferenceValue.class);
+                    dsView.remove(new GridCacheInternalKeyImpl(name));
                 }
                 finally {
                     dsCacheCtx.gate().leave();
@@ -848,9 +844,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
                 dsCacheCtx.gate().enter();
 
                 try {
-                    GridCacheInternal key = new GridCacheInternalKeyImpl(name);
-
-                    removeInternal(key, GridCacheAtomicStampedValue.class);
+                    dsView.remove(new GridCacheInternalKeyImpl(name));
                 }
                 finally {
                     dsCacheCtx.gate().leave();
@@ -1463,43 +1457,6 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
     }
 
     /**
-     * Remove internal entry by key from cache.
-     *
-     * @param key Internal entry key.
-     * @param cls Class of object which will be removed. If cached object has different type exception will be thrown.
-     * @return Method returns true if sequence has been removed and false if it's not cached.
-     * @throws IgniteCheckedException If removing failed or class of object is different to expected class.
-     */
-    private <R> boolean removeInternal(final GridCacheInternal key, final Class<R> cls) throws IgniteCheckedException {
-        return CU.outTx(
-            new Callable<Boolean>() {
-                @Override public Boolean call() throws Exception {
-                    try (GridNearTxLocal tx = CU.txStartInternal(dsCacheCtx, dsView, PESSIMISTIC, REPEATABLE_READ)) {
-                        // Check correctness type of removable object.
-                        R val = cast(dsView.get(key), cls);
-
-                        if (val != null) {
-                            dsView.remove(key);
-
-                            tx.commit();
-                        }
-                        else
-                            tx.setRollbackOnly();
-
-                        return val != null;
-                    }
-                    catch (Error | Exception e) {
-                        U.error(log, "Failed to remove data structure: " + key, e);
-
-                        throw e;
-                    }
-                }
-            },
-            dsCacheCtx
-        );
-    }
-
-    /**
      *
      */
     static class DataStructuresEntryFilter implements CacheEntryEventSerializableFilter<Object, Object> {
@@ -1716,7 +1673,7 @@ public final class DataStructuresProcessor extends GridProcessorAdapter {
      */
     public static <R> R retry(IgniteLogger log, Callable<R> call) throws IgniteCheckedException {
         try {
-            return GridCacheUtils.retryTopologySafe(call).call();
+            return GridCacheUtils.retryTopologySafe(call);
         }
         catch (IgniteCheckedException e) {
             throw e;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
index b0e0713..f74d8a4 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicLongImpl.java
@@ -32,8 +32,6 @@ import org.apache.ignite.cache.CacheEntryProcessor;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
-import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
@@ -86,8 +84,10 @@ public final class GridCacheAtomicLongImpl implements GridCacheAtomicLongEx, Ext
      * @param atomicView Atomic projection.
      * @param ctx CacheContext.
      */
-    public GridCacheAtomicLongImpl(String name, GridCacheInternalKey key,
-        IgniteInternalCache<GridCacheInternalKey, GridCacheAtomicLongValue> atomicView, GridCacheContext ctx) {
+    public GridCacheAtomicLongImpl(String name,
+        GridCacheInternalKey key,
+        IgniteInternalCache<GridCacheInternalKey, GridCacheAtomicLongValue> atomicView,
+        GridCacheContext ctx) {
         assert key != null;
         assert atomicView != null;
         assert ctx != null;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
index 6911b3f..a026bf3 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicReferenceImpl.java
@@ -23,23 +23,21 @@ import java.io.InvalidObjectException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
-import java.util.concurrent.Callable;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.EntryProcessorResult;
+import javax.cache.processor.MutableEntry;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.CacheEntryProcessor;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
 import org.apache.ignite.internal.util.typedef.F;
-import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.S;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 
-import static org.apache.ignite.internal.processors.cache.GridCacheUtils.retryTopologySafe;
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
-
 /**
  * Cache atomic reference implementation.
  */
@@ -76,18 +74,6 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
     /** Cache context. */
     private GridCacheContext ctx;
 
-    /** Callable for {@link #get} operation */
-    private final Callable<T> getCall = new Callable<T>() {
-        @Override public T call() throws Exception {
-            GridCacheAtomicReferenceValue<T> ref = atomicView.get(key);
-
-            if (ref == null)
-                throw new IgniteCheckedException("Failed to find atomic reference with given name: " + name);
-
-            return ref.get();
-        }
-    };
-
     /**
      * Empty constructor required by {@link Externalizable}.
      */
@@ -130,7 +116,12 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
         checkRemoved();
 
         try {
-            return CU.outTx(getCall, ctx);
+            GridCacheAtomicReferenceValue<T> ref = atomicView.get(key);
+
+            if (ref == null)
+                throw new IgniteCheckedException("Failed to find atomic reference with given name: " + name);
+
+            return ref.get();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -142,7 +133,10 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
         checkRemoved();
 
         try {
-            CU.outTx(internalSet(val), ctx);
+            atomicView.invoke(key, new ReferenceSetEntryProcessor<>(val));
+        }
+        catch (EntryProcessorException e) {
+            throw new IgniteException(e.getMessage(), e);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -151,20 +145,42 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
 
     /** {@inheritDoc} */
     @Override public boolean compareAndSet(T expVal, T newVal) {
-        return compareAndSetAndGet(newVal, expVal) == expVal;
+        try {
+            EntryProcessorResult<Boolean> res =
+                atomicView.invoke(key, new ReferenceCompareAndSetEntryProcessor<>(expVal, newVal));
+
+            assert res != null && res.get() != null : res;
+
+            return res.get();
+        }
+        catch (EntryProcessorException e) {
+            throw new IgniteException(e.getMessage(), e);
+        }
+        catch (IgniteCheckedException e) {
+            throw U.convertException(e);
+        }
     }
 
     /**
      * Compares current value with specified value for equality and, if they are equal, replaces current value.
      *
      * @param newVal New value to set.
+     * @param expVal Expected value.
      * @return Original value.
      */
     public T compareAndSetAndGet(T newVal, T expVal) {
         checkRemoved();
 
         try {
-            return CU.outTx(internalCompareAndSetAndGet(expVal, newVal), ctx);
+            EntryProcessorResult<T> res =
+                atomicView.invoke(key, new ReferenceCompareAndSetAndGetEntryProcessor<T>(expVal, newVal));
+
+            assert res != null;
+
+            return res.get();
+        }
+        catch (EntryProcessorException e) {
+            throw new IgniteException(e.getMessage(), e);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -205,82 +221,6 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
     }
 
     /**
-     * Method returns callable for execution {@link #set(Object)} operation in async and sync mode.
-     *
-     * @param val Value will be set in reference .
-     * @return Callable for execution in async and sync mode.
-     */
-    private Callable<Boolean> internalSet(final T val) {
-        return retryTopologySafe(new Callable<Boolean>() {
-            @Override public Boolean call() throws Exception {
-                try (GridNearTxLocal tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
-                    GridCacheAtomicReferenceValue<T> ref = atomicView.get(key);
-
-                    if (ref == null)
-                        throw new IgniteCheckedException("Failed to find atomic reference with given name: " + name);
-
-                    ref.set(val);
-
-                    atomicView.put(key, ref);
-
-                    tx.commit();
-
-                    return true;
-                }
-                catch (Error | Exception e) {
-                    U.error(log, "Failed to set value [val=" + val + ", atomicReference=" + this + ']', e);
-
-                    throw e;
-                }
-            }
-        });
-    }
-
-    /**
-     * Conditionally sets the new value. It will be set if {@code expValPred} is
-     * evaluate to {@code true}.
-     *
-     * @param expVal Expected value.
-     * @param newVal New value.
-     * @return Callable for execution in async and sync mode.
-     */
-    private Callable<T> internalCompareAndSetAndGet(final T expVal, final T newVal) {
-        return retryTopologySafe(new Callable<T>() {
-            @Override public T call() throws Exception {
-                try (GridNearTxLocal tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
-                    GridCacheAtomicReferenceValue<T> ref = atomicView.get(key);
-
-                    if (ref == null)
-                        throw new IgniteCheckedException("Failed to find atomic reference with given name: " + name);
-
-                    T origVal = ref.get();
-
-                    if (!F.eq(expVal, origVal)) {
-                        tx.setRollbackOnly();
-
-                        return origVal;
-                    }
-                    else {
-                        ref.set(newVal);
-
-                        atomicView.getAndPut(key, ref);
-
-                        tx.commit();
-
-                        return expVal;
-                    }
-                }
-                catch (Error | Exception e) {
-                    U.error(log, "Failed to compare and value [expVal=" + expVal + ", newVal" +
-                        newVal + ", atomicReference" + this + ']', e);
-
-                    throw e;
-                }
-            }
-        });
-    }
-
-    /**
      * Check removed status.
      *
      * @throws IllegalStateException If removed.
@@ -349,6 +289,136 @@ public final class GridCacheAtomicReferenceImpl<T> implements GridCacheAtomicRef
         }
     }
 
+    /**
+     *
+     */
+    static class ReferenceSetEntryProcessor<T> implements
+        CacheEntryProcessor<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>, Void> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final T newVal;
+
+        /**
+         * @param newVal New value.
+         */
+        ReferenceSetEntryProcessor(T newVal) {
+            this.newVal = newVal;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Void process(MutableEntry<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>> e,
+            Object... args) {
+            GridCacheAtomicReferenceValue val = e.getValue();
+
+            if (val == null)
+                throw new EntryProcessorException("Failed to find atomic reference with given name: " + e.getKey().name());
+
+            e.setValue(new GridCacheAtomicReferenceValue<>(newVal));
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(ReferenceSetEntryProcessor.class, this);
+        }
+    }
+
+    /**
+     *
+     */
+    static class ReferenceCompareAndSetEntryProcessor<T> implements
+        CacheEntryProcessor<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>, Boolean> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final T expVal;
+
+        /** */
+        private final T newVal;
+
+        /**
+         * @param expVal Expected value.
+         * @param newVal New value.
+         */
+        ReferenceCompareAndSetEntryProcessor(T expVal, T newVal) {
+            this.expVal = expVal;
+            this.newVal = newVal;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Boolean process(MutableEntry<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>> e,
+            Object... args) {
+            GridCacheAtomicReferenceValue<T> val = e.getValue();
+
+            if (val == null)
+                throw new EntryProcessorException("Failed to find atomic reference with given name: " + e.getKey().name());
+
+            T curVal = val.get();
+
+            if (F.eq(expVal, curVal)) {
+                e.setValue(new GridCacheAtomicReferenceValue<T>(newVal));
+
+                return true;
+            }
+
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(ReferenceCompareAndSetEntryProcessor.class, this);
+        }
+    }
+
+    /**
+     *
+     */
+    static class ReferenceCompareAndSetAndGetEntryProcessor<T> implements
+        CacheEntryProcessor<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>, T> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final T expVal;
+
+        /** */
+        private final T newVal;
+
+        /**
+         * @param expVal Expected value.
+         * @param newVal New value.
+         */
+        ReferenceCompareAndSetAndGetEntryProcessor(T expVal, T newVal) {
+            this.expVal = expVal;
+            this.newVal = newVal;
+        }
+
+        /** {@inheritDoc} */
+        @Override public T process(MutableEntry<GridCacheInternalKey, GridCacheAtomicReferenceValue<T>> e,
+            Object... args) {
+            GridCacheAtomicReferenceValue<T> val = e.getValue();
+
+            if (val == null)
+                throw new EntryProcessorException("Failed to find atomic reference with given name: " + e.getKey().name());
+
+            T curVal = val.get();
+
+            if (F.eq(expVal, curVal))
+                e.setValue(new GridCacheAtomicReferenceValue<T>(newVal));
+
+            return curVal;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return S.toString(ReferenceCompareAndSetAndGetEntryProcessor.class, this);
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return S.toString(GridCacheAtomicReferenceImpl.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
index 87aae8b..4a6f476 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicSequenceImpl.java
@@ -32,11 +32,9 @@ import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
 import org.apache.ignite.internal.GridKernalContext;
-import org.apache.ignite.internal.IgniteInternalFuture;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
 import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
-import org.apache.ignite.internal.util.future.GridFinishedFuture;
 import org.apache.ignite.internal.util.tostring.GridToStringInclude;
 import org.apache.ignite.internal.util.typedef.internal.A;
 import org.apache.ignite.internal.util.typedef.internal.CU;
@@ -255,7 +253,7 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
             if (updateGuard.compareAndSet(false, true)) {
                 try {
                     try {
-                        return updateCall.call();
+                        return retryTopologySafe(updateCall);
                     }
                     catch (IgniteCheckedException | IgniteException | IllegalStateException e) {
                         throw e;
@@ -302,86 +300,6 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
         }
     }
 
-    /**
-     * Asynchronous sequence update operation. Will add given amount to the sequence value.
-     *
-     * @param l Increment amount.
-     * @param updateCall Cache call that will update sequence reservation count in accordance with l.
-     * @param updated If {@code true}, will return sequence value after update, otherwise will return sequence value
-     *      prior to update.
-     * @return Future indicating sequence value.
-     * @throws IgniteCheckedException If update failed.
-     */
-    @SuppressWarnings("SignalWithoutCorrespondingAwait")
-    private IgniteInternalFuture<Long> internalUpdateAsync(long l, @Nullable Callable<Long> updateCall, boolean updated)
-        throws IgniteCheckedException {
-        checkRemoved();
-
-        A.ensure(l > 0, " Parameter mustn't be less then 1: " + l);
-
-        lock.lock();
-
-        try {
-            // If reserved range isn't exhausted.
-            if (locVal + l <= upBound) {
-                long curVal = locVal;
-
-                locVal += l;
-
-                return new GridFinishedFuture<>(updated ? locVal : curVal);
-            }
-        }
-        finally {
-            lock.unlock();
-        }
-
-        if (updateCall == null)
-            updateCall = internalUpdate(l, updated);
-
-        while (true) {
-            if (updateGuard.compareAndSet(false, true)) {
-                try {
-                    // This call must be outside lock.
-                    return ctx.closures().callLocalSafe(updateCall, true);
-                }
-                finally {
-                    lock.lock();
-
-                    try {
-                        updateGuard.set(false);
-
-                        cond.signalAll();
-                    }
-                    finally {
-                        lock.unlock();
-                    }
-                }
-            }
-            else {
-                lock.lock();
-
-                try {
-                    while (locVal >= upBound && updateGuard.get())
-                        U.await(cond, 500, MILLISECONDS);
-
-                    checkRemoved();
-
-                    // If reserved range isn't exhausted.
-                    if (locVal + l <= upBound) {
-                        long curVal = locVal;
-
-                        locVal += l;
-
-                        return new GridFinishedFuture<>(updated ? locVal : curVal);
-                    }
-                }
-                finally {
-                    lock.unlock();
-                }
-            }
-        }
-    }
-
     /** Get local batch size for this sequences.
      *
      * @return Sequence batch size.
@@ -484,7 +402,7 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
      */
     @SuppressWarnings("TooBroadScope")
     private Callable<Long> internalUpdate(final long l, final boolean updated) {
-        return retryTopologySafe(new Callable<Long>() {
+        return new Callable<Long>() {
             @Override public Long call() throws Exception {
                 try (GridNearTxLocal tx = CU.txStartInternal(ctx, seqView, PESSIMISTIC, REPEATABLE_READ)) {
                     GridCacheAtomicSequenceValue seq = seqView.get(key);
@@ -555,7 +473,7 @@ public final class GridCacheAtomicSequenceImpl implements GridCacheAtomicSequenc
                     throw e;
                 }
             }
-        });
+        };
     }
 
     /** {@inheritDoc} */

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
index 14f80e2..1e4da30 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheAtomicStampedImpl.java
@@ -23,24 +23,20 @@ import java.io.InvalidObjectException;
 import java.io.ObjectInput;
 import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
-import java.util.concurrent.Callable;
+import javax.cache.processor.EntryProcessorException;
+import javax.cache.processor.EntryProcessorResult;
+import javax.cache.processor.MutableEntry;
 import org.apache.ignite.IgniteCheckedException;
+import org.apache.ignite.IgniteException;
 import org.apache.ignite.IgniteLogger;
+import org.apache.ignite.cache.CacheEntryProcessor;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
-import org.apache.ignite.internal.processors.cache.distributed.near.GridNearTxLocal;
-import org.apache.ignite.internal.util.F0;
 import org.apache.ignite.internal.util.tostring.GridToStringBuilder;
-import org.apache.ignite.internal.util.typedef.internal.CU;
+import org.apache.ignite.internal.util.typedef.F;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
-import org.apache.ignite.lang.IgniteClosure;
-import org.apache.ignite.lang.IgnitePredicate;
-
-import static org.apache.ignite.internal.util.typedef.internal.CU.retryTopologySafe;
-import static org.apache.ignite.transactions.TransactionConcurrency.PESSIMISTIC;
-import static org.apache.ignite.transactions.TransactionIsolation.REPEATABLE_READ;
 
 /**
  * Cache atomic stamped implementation.
@@ -78,42 +74,6 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
     /** Cache context. */
     private GridCacheContext ctx;
 
-    /** Callable for {@link #get()} operation */
-    private final Callable<IgniteBiTuple<T, S>> getCall = retryTopologySafe(new Callable<IgniteBiTuple<T, S>>() {
-        @Override public IgniteBiTuple<T, S> call() throws Exception {
-            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
-
-            if (stmp == null)
-                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
-
-            return stmp.get();
-        }
-    });
-
-    /** Callable for {@link #value()} operation */
-    private final Callable<T> valCall = retryTopologySafe(new Callable<T>() {
-        @Override public T call() throws Exception {
-            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
-
-            if (stmp == null)
-                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
-
-            return stmp.value();
-        }
-    });
-
-    /** Callable for {@link #stamp()} operation */
-    private final Callable<S> stampCall = retryTopologySafe(new Callable<S>() {
-        @Override public S call() throws Exception {
-            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
-
-            if (stmp == null)
-                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
-
-            return stmp.stamp();
-        }
-    });
-
     /**
      * Empty constructor required by {@link Externalizable}.
      */
@@ -129,8 +89,10 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
      * @param atomicView Atomic projection.
      * @param ctx Cache context.
      */
-    public GridCacheAtomicStampedImpl(String name, GridCacheInternalKey key, IgniteInternalCache<GridCacheInternalKey,
-            GridCacheAtomicStampedValue<T, S>> atomicView, GridCacheContext ctx) {
+    public GridCacheAtomicStampedImpl(String name,
+        GridCacheInternalKey key,
+        IgniteInternalCache<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>> atomicView,
+        GridCacheContext ctx) {
         assert key != null;
         assert atomicView != null;
         assert ctx != null;
@@ -154,7 +116,12 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(getCall, ctx);
+            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
+
+            if (stmp == null)
+                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
+
+            return stmp.get();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -166,7 +133,10 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            CU.outTx(internalSet(val, stamp), ctx);
+            atomicView.invoke(key, new StampedSetEntryProcessor<>(val, stamp));
+        }
+        catch (EntryProcessorException e) {
+            throw new IgniteException(e.getMessage(), e);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -178,8 +148,15 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(internalCompareAndSet(F0.equalTo(expVal), wrapperClosure(newVal),
-                F0.equalTo(expStamp), wrapperClosure(newStamp)), ctx);
+            EntryProcessorResult<Boolean> res =
+                atomicView.invoke(key, new StampedCompareAndSetEntryProcessor<>(expVal, expStamp, newVal, newStamp));
+
+            assert res != null && res.get() != null : res;
+
+            return res.get();
+        }
+        catch (EntryProcessorException e) {
+            throw new IgniteException(e.getMessage(), e);
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -191,7 +168,12 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(stampCall, ctx);
+            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
+
+            if (stmp == null)
+                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
+
+            return stmp.stamp();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -203,7 +185,12 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         checkRemoved();
 
         try {
-            return CU.outTx(valCall, ctx);
+            GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
+
+            if (stmp == null)
+                throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
+
+            return stmp.value();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -243,100 +230,6 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         }
     }
 
-    /**
-     * Method make wrapper closure for existing value.
-     *
-     * @param val Value.
-     * @return Closure.
-     */
-    private <N> IgniteClosure<N, N> wrapperClosure(final N val) {
-        return new IgniteClosure<N, N>() {
-            @Override public N apply(N e) {
-                return val;
-            }
-        };
-    }
-
-    /**
-     * Method returns callable for execution {@link #set(Object,Object)}} operation in async and sync mode.
-     *
-     * @param val Value will be set in the atomic stamped.
-     * @param stamp Stamp will be set in the atomic stamped.
-     * @return Callable for execution in async and sync mode.
-     */
-    private Callable<Boolean> internalSet(final T val, final S stamp) {
-        return retryTopologySafe(new Callable<Boolean>() {
-            @Override public Boolean call() throws Exception {
-                try (GridNearTxLocal tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
-                    GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
-
-                    if (stmp == null)
-                        throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
-
-                    stmp.set(val, stamp);
-
-                    atomicView.put(key, stmp);
-
-                    tx.commit();
-
-                    return true;
-                }
-                catch (Error | Exception e) {
-                    U.error(log, "Failed to set [val=" + val + ", stamp=" + stamp + ", atomicStamped=" + this + ']', e);
-
-                    throw e;
-                }
-            }
-        });
-    }
-
-    /**
-     * Conditionally asynchronously sets the new value and new stamp. They will be set if
-     * {@code expValPred} and {@code expStampPred} both evaluate to {@code true}.
-     *
-     * @param expValPred Predicate which should evaluate to {@code true} for value to be set
-     * @param newValClos Closure generates new value.
-     * @param expStampPred Predicate which should evaluate to {@code true} for value to be set
-     * @param newStampClos Closure generates new stamp value.
-     * @return Callable for execution in async and sync mode.
-     */
-    private Callable<Boolean> internalCompareAndSet(final IgnitePredicate<T> expValPred,
-        final IgniteClosure<T, T> newValClos, final IgnitePredicate<S> expStampPred,
-        final IgniteClosure<S, S> newStampClos) {
-        return retryTopologySafe(new Callable<Boolean>() {
-            @Override public Boolean call() throws Exception {
-                try (GridNearTxLocal tx = CU.txStartInternal(ctx, atomicView, PESSIMISTIC, REPEATABLE_READ)) {
-                    GridCacheAtomicStampedValue<T, S> stmp = atomicView.get(key);
-
-                    if (stmp == null)
-                        throw new IgniteCheckedException("Failed to find atomic stamped with given name: " + name);
-
-                    if (!(expValPred.apply(stmp.value()) && expStampPred.apply(stmp.stamp()))) {
-                        tx.setRollbackOnly();
-
-                        return false;
-                    }
-                    else {
-                        stmp.set(newValClos.apply(stmp.value()), newStampClos.apply(stmp.stamp()));
-
-                        atomicView.getAndPut(key, stmp);
-
-                        tx.commit();
-
-                        return true;
-                    }
-                }
-                catch (Error | Exception e) {
-                    U.error(log, "Failed to compare and set [expValPred=" + expValPred + ", newValClos=" +
-                        newValClos + ", expStampPred=" + expStampPred + ", newStampClos=" + newStampClos +
-                        ", atomicStamped=" + this + ']', e);
-
-                    throw e;
-                }
-            }
-        });
-    }
-
     /** {@inheritDoc} */
     @Override public void writeExternal(ObjectOutput out) throws IOException {
         out.writeObject(ctx.kernalContext());
@@ -406,6 +299,104 @@ public final class GridCacheAtomicStampedImpl<T, S> implements GridCacheAtomicSt
         return new IllegalStateException("Atomic stamped was removed from cache: " + name);
     }
 
+    /**
+     *
+     */
+    static class StampedSetEntryProcessor<T, S> implements
+        CacheEntryProcessor<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>, Void> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final T newVal;
+
+        /** */
+        private final S newStamp;
+
+        /**
+         * @param newVal New value.
+         * @param newStamp New stamp value.
+         */
+        StampedSetEntryProcessor(T newVal, S newStamp) {
+            this.newVal = newVal;
+            this.newStamp = newStamp;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Void process(MutableEntry<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>> e,
+            Object... args) {
+            GridCacheAtomicStampedValue val = e.getValue();
+
+            if (val == null)
+                throw new EntryProcessorException("Failed to find atomic stamped with given name: " + e.getKey().name());
+
+            e.setValue(new GridCacheAtomicStampedValue<>(newVal, newStamp));
+
+            return null;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return GridToStringBuilder.toString(StampedSetEntryProcessor.class, this);
+        }
+    }
+
+    /**
+     *
+     */
+    static class StampedCompareAndSetEntryProcessor<T, S> implements
+        CacheEntryProcessor<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>, Boolean> {
+        /** */
+        private static final long serialVersionUID = 0L;
+
+        /** */
+        private final T expVal;
+
+        /** */
+        private final S expStamp;
+
+        /** */
+        private final T newVal;
+
+        /** */
+        private final S newStamp;
+
+        /**
+         * @param expVal Expected value.
+         * @param expStamp Expected stamp.
+         * @param newVal New value.
+         * @param newStamp New stamp value.
+         */
+        StampedCompareAndSetEntryProcessor(T expVal, S expStamp, T newVal, S newStamp) {
+            this.expVal = expVal;
+            this.expStamp = expStamp;
+            this.newVal = newVal;
+            this.newStamp = newStamp;
+        }
+
+        /** {@inheritDoc} */
+        @Override public Boolean process(MutableEntry<GridCacheInternalKey, GridCacheAtomicStampedValue<T, S>> e,
+            Object... args) {
+            GridCacheAtomicStampedValue val = e.getValue();
+
+            if (val == null)
+                throw new EntryProcessorException("Failed to find atomic stamped with given name: " + e.getKey().name());
+
+            if (F.eq(expVal, val.value()) && F.eq(expStamp, val.stamp())) {
+                e.setValue(new GridCacheAtomicStampedValue<>(newVal, newStamp));
+
+                return true;
+            }
+
+            return false;
+        }
+
+        /** {@inheritDoc} */
+        @Override public String toString() {
+            return GridToStringBuilder.toString(StampedCompareAndSetEntryProcessor.class, this);
+        }
+    }
+
     /** {@inheritDoc} */
     @Override public String toString() {
         return GridToStringBuilder.toString(GridCacheAtomicStampedImpl.class, this);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
index 45c3677..67d479f 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheCountDownLatchImpl.java
@@ -151,7 +151,9 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     /** {@inheritDoc} */
     @Override public int count() {
         try {
-            return CU.outTx(new GetCountCallable(), ctx);
+            GridCacheCountDownLatchValue latchVal = latchView.get(key);
+
+            return latchVal == null ? 0 : latchVal.get();
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -207,7 +209,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
         A.ensure(val > 0, "val should be positive");
 
         try {
-            return CU.outTx(retryTopologySafe(new CountDownCallable(val)), ctx);
+            return retryTopologySafe(new CountDownCallable(val));
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -217,7 +219,7 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     /** {@inheritDoc}*/
     @Override public void countDownAll() {
         try {
-            CU.outTx(retryTopologySafe(new CountDownCallable(0)), ctx);
+            retryTopologySafe(new CountDownCallable(0));
         }
         catch (IgniteCheckedException e) {
             throw U.convertException(e);
@@ -254,23 +256,22 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
             int state = initGuard.get();
 
             if (state != READY_LATCH_STATE) {
-                /** Internal latch is not fully initialized yet. Remember latest latch value. */
+                /* Internal latch is not fully initialized yet. Remember latest latch value. */
                 lastLatchVal = cnt;
 
                 return;
             }
 
-            /** 'synchronized' statement guarantees visibility of internalLatch. No need to make it volatile. */
+            /* 'synchronized' statement guarantees visibility of internalLatch. No need to make it volatile. */
             latch0 = internalLatch;
         }
 
-        /** Internal latch is fully initialized and ready for the usage. */
+        /* Internal latch is fully initialized and ready for the usage. */
 
         assert latch0 != null;
 
         while (latch0.getCount() > cnt)
             latch0.countDown();
-
     }
 
     /**
@@ -279,27 +280,24 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     private void initializeLatch() throws IgniteCheckedException {
         if (initGuard.compareAndSet(UNINITIALIZED_LATCH_STATE, CREATING_LATCH_STATE)) {
             try {
-                internalLatch = CU.outTx(
-                    retryTopologySafe(new Callable<CountDownLatch>() {
-                        @Override public CountDownLatch call() throws Exception {
-                            try (GridNearTxLocal tx = CU.txStartInternal(ctx, latchView, PESSIMISTIC, REPEATABLE_READ)) {
-                                GridCacheCountDownLatchValue val = latchView.get(key);
+                internalLatch = retryTopologySafe(new Callable<CountDownLatch>() {
+                    @Override public CountDownLatch call() throws Exception {
+                        try (GridNearTxLocal tx = CU.txStartInternal(ctx, latchView, PESSIMISTIC, REPEATABLE_READ)) {
+                            GridCacheCountDownLatchValue val = latchView.get(key);
 
-                                if (val == null) {
-                                    if (log.isDebugEnabled())
-                                        log.debug("Failed to find count down latch with given name: " + name);
+                            if (val == null) {
+                                if (log.isDebugEnabled())
+                                    log.debug("Failed to find count down latch with given name: " + name);
 
-                                    return new CountDownLatch(0);
-                                }
+                                return new CountDownLatch(0);
+                            }
 
-                                tx.commit();
+                            tx.commit();
 
-                                return new CountDownLatch(val.get());
-                            }
+                            return new CountDownLatch(val.get());
                         }
-                    }),
-                    ctx
-                );
+                    }
+                });
 
                 synchronized (initGuard) {
                     if (lastLatchVal != null) {
@@ -380,18 +378,6 @@ public final class GridCacheCountDownLatchImpl implements GridCacheCountDownLatc
     /**
      *
      */
-    private class GetCountCallable implements Callable<Integer> {
-        /** {@inheritDoc} */
-        @Override public Integer call() throws Exception {
-            GridCacheCountDownLatchValue latchVal = latchView.get(key);
-
-            return latchVal == null ? 0 : latchVal.get();
-        }
-    }
-
-    /**
-     *
-     */
     private class CountDownCallable implements Callable<Integer> {
         /** Value to count down on (if 0 then latch is counted down to 0). */
         private final int val;

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheLockImpl.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheLockImpl.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheLockImpl.java
index 5f0cb44..ca21271 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheLockImpl.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheLockImpl.java
@@ -514,11 +514,10 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
         /**
          * This method is used for synchronizing the reentrant lock state across all nodes.
          */
-        protected boolean compareAndSetGlobalState(final int expVal, final int newVal,
+        boolean compareAndSetGlobalState(final int expVal, final int newVal,
             final Thread newThread, final boolean bargingProhibited) {
             try {
-                return CU.outTx(
-                    retryTopologySafe(new Callable<Boolean>() {
+                return retryTopologySafe(new Callable<Boolean>() {
                         @Override public Boolean call() throws Exception {
                             try (GridNearTxLocal tx = CU.txStartInternal(ctx, lockView, PESSIMISTIC, REPEATABLE_READ)) {
                                 GridCacheLockState val = lockView.get(key);
@@ -592,9 +591,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
                                 throw e;
                             }
                         }
-                    }),
-                    ctx
-                );
+                    });
             }
             catch (IgniteCheckedException e) {
                 throw U.convertException(e);
@@ -606,12 +603,11 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
          *
          * @param cancelled true if acquire attempt is cancelled, false if acquire attempt should be registered.
          */
-        protected boolean synchronizeQueue(final boolean cancelled, final Thread thread) {
+        boolean synchronizeQueue(final boolean cancelled, final Thread thread) {
             final AtomicBoolean interrupted = new AtomicBoolean(false);
 
             try {
-                return CU.outTx(
-                    retryTopologySafe(new Callable<Boolean>() {
+                return retryTopologySafe(new Callable<Boolean>() {
                         @Override public Boolean call() throws Exception {
                             try (GridNearTxLocal tx = CU.txStartInternal(ctx, lockView, PESSIMISTIC, REPEATABLE_READ)) {
                                 GridCacheLockState val = lockView.get(key);
@@ -684,9 +680,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
                                 throw e;
                             }
                         }
-                    }),
-                    ctx
-                );
+                    });
             }
             catch (IgniteCheckedException e) {
                 throw U.convertException(e);
@@ -702,13 +696,14 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
          * Sets the global state across all nodes after releasing the reentrant lock.
          *
          * @param newVal New state.
-         * @param lastCondition Id of the condition await is called.
+         * @param lastCond Id of the condition await is called.
          * @param outgoingSignals Map containing signal calls on this node since the last acquisition of the lock.
          */
-        protected boolean setGlobalState(final int newVal, @Nullable final String lastCondition, final Map<String, Integer> outgoingSignals) {
+        protected boolean setGlobalState(final int newVal,
+            @Nullable final String lastCond,
+            final Map<String, Integer> outgoingSignals) {
             try {
-                return CU.outTx(
-                    retryTopologySafe(new Callable<Boolean>() {
+                return retryTopologySafe(new Callable<Boolean>() {
                         @Override public Boolean call() throws Exception {
                             try (GridNearTxLocal tx = CU.txStartInternal(ctx, lockView, PESSIMISTIC, REPEATABLE_READ)) {
                                 GridCacheLockState val = lockView.get(key);
@@ -749,9 +744,8 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                                         if (list != null && !list.isEmpty()) {
                                             // Check if signalAll was called.
-                                            if (cnt == 0) {
+                                            if (cnt == 0)
                                                 cnt = list.size();
-                                            }
 
                                             // Remove from global condition queue.
                                             for (int i = 0; i < cnt; i++) {
@@ -785,20 +779,20 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                                 // Check if this release is called after condition.await() call;
                                 // If true, add this node to the global waiting queue.
-                                if (lastCondition != null) {
+                                if (lastCond != null) {
                                     LinkedList<UUID> queue;
 
                                     //noinspection IfMayBeConditional
-                                    if (!condMap.containsKey(lastCondition))
+                                    if (!condMap.containsKey(lastCond))
                                         // New condition object.
                                         queue = new LinkedList<>();
                                     else
                                         // Existing condition object.
-                                        queue = condMap.get(lastCondition);
+                                        queue = condMap.get(lastCond);
 
                                     queue.add(thisNode);
 
-                                    condMap.put(lastCondition, queue);
+                                    condMap.put(lastCond, queue);
                                 }
 
                                 val.setConditionMap(condMap);
@@ -822,16 +816,14 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
                                 throw e;
                             }
                         }
-                    }),
-                    ctx
-                );
+                    });
             }
             catch (IgniteCheckedException e) {
                 throw U.convertException(e);
             }
         }
 
-        protected synchronized boolean checkIncomingSignals(GridCacheLockState state) {
+        synchronized boolean checkIncomingSignals(GridCacheLockState state) {
             if (state.getSignals() == null)
                 return false;
 
@@ -880,16 +872,16 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
             private final String name;
 
             /** */
-            private final AbstractQueuedSynchronizer.ConditionObject object;
+            private final AbstractQueuedSynchronizer.ConditionObject obj;
 
             /**
              * @param name Condition name.
-             * @param object Condition object.
+             * @param obj Condition object.
              */
-            protected IgniteConditionObject(String name, ConditionObject object) {
+            protected IgniteConditionObject(String name, ConditionObject obj) {
                 this.name = name;
 
-                this.object = object;
+                this.obj = obj;
             }
 
             /**
@@ -911,7 +903,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                     lastCondition = name;
 
-                    object.await();
+                    obj.await();
 
                     sync.validate(true);
                 }
@@ -933,7 +925,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                     lastCondition = name;
 
-                    object.awaitUninterruptibly();
+                    obj.awaitUninterruptibly();
 
                     sync.validate(false);
                 }
@@ -952,7 +944,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                     lastCondition = name;
 
-                    long result =  object.awaitNanos(nanosTimeout);
+                    long result =  obj.awaitNanos(nanosTimeout);
 
                     sync.validate(true);
 
@@ -976,7 +968,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                     lastCondition = name;
 
-                    boolean result = object.await(time, unit);
+                    boolean result = obj.await(time, unit);
 
                     sync.validate(true);
 
@@ -1000,7 +992,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
 
                     lastCondition = name;
 
-                    boolean result = object.awaitUntil(deadline);
+                    boolean result = obj.awaitUntil(deadline);
 
                     sync.validate(true);
 
@@ -1085,8 +1077,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
     private void initializeReentrantLock() throws IgniteCheckedException {
         if (initGuard.compareAndSet(false, true)) {
             try {
-                sync = CU.outTx(
-                    retryTopologySafe(new Callable<Sync>() {
+                sync = retryTopologySafe(new Callable<Sync>() {
                         @Override public Sync call() throws Exception {
                             try (GridNearTxLocal tx = CU.txStartInternal(ctx, lockView, PESSIMISTIC, REPEATABLE_READ)) {
                                 GridCacheLockState val = lockView.get(key);
@@ -1103,9 +1094,7 @@ public final class GridCacheLockImpl implements GridCacheLockEx, Externalizable
                                 return new Sync(val);
                             }
                         }
-                    }),
-                    ctx
-                );
+                    });
 
                 if (log.isDebugEnabled())
                     log.debug("Initialized internal sync structure: " + sync);

http://git-wip-us.apache.org/repos/asf/ignite/blob/1e186403/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueProxy.java
----------------------------------------------------------------------
diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueProxy.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueProxy.java
index e38c772..b31a154 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueProxy.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/GridCacheQueueProxy.java
@@ -25,14 +25,12 @@ import java.io.ObjectOutput;
 import java.io.ObjectStreamException;
 import java.util.Collection;
 import java.util.Iterator;
-import java.util.concurrent.Callable;
 import java.util.concurrent.TimeUnit;
 import org.apache.ignite.IgniteCheckedException;
 import org.apache.ignite.IgniteQueue;
 import org.apache.ignite.internal.GridKernalContext;
 import org.apache.ignite.internal.processors.cache.GridCacheContext;
 import org.apache.ignite.internal.processors.cache.GridCacheGateway;
-import org.apache.ignite.internal.util.typedef.internal.CU;
 import org.apache.ignite.internal.util.typedef.internal.U;
 import org.apache.ignite.lang.IgniteBiTuple;
 import org.apache.ignite.lang.IgniteCallable;
@@ -93,18 +91,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.add(item);
-                    }
-                }, cctx);
-
             return delegate.add(item);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -115,18 +103,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.offer(item);
-                    }
-                }, cctx);
-
             return delegate.offer(item);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -137,18 +115,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.addAll(items);
-                    }
-                }, cctx);
-
             return delegate.addAll(items);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -160,18 +128,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.contains(item);
-                    }
-                }, cctx);
-
             return delegate.contains(item);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -182,18 +140,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.containsAll(items);
-                    }
-                }, cctx);
-
             return delegate.containsAll(items);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -204,20 +152,7 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional()) {
-                CU.outTx(new Callable<Void>() {
-                    @Override public Void call() throws Exception {
-                        delegate.clear();
-
-                        return null;
-                    }
-                }, cctx);
-            }
-            else
-                delegate.clear();
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
+            delegate.clear();
         }
         finally {
             gate.leave();
@@ -230,18 +165,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.remove(item);
-                    }
-                }, cctx);
-
             return delegate.remove(item);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -252,18 +177,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.removeAll(items);
-                    }
-                }, cctx);
-
             return delegate.removeAll(items);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -274,18 +189,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.isEmpty();
-                    }
-                }, cctx);
-
             return delegate.isEmpty();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -296,18 +201,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Iterator<T>>() {
-                    @Override public Iterator<T> call() throws Exception {
-                        return delegate.iterator();
-                    }
-                }, cctx);
-
             return delegate.iterator();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -318,18 +213,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Object[]>() {
-                    @Override public Object[] call() throws Exception {
-                        return delegate.toArray();
-                    }
-                }, cctx);
-
             return delegate.toArray();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -341,18 +226,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T1[]>() {
-                    @Override public T1[] call() throws Exception {
-                        return delegate.toArray(a);
-                    }
-                }, cctx);
-
             return delegate.toArray(a);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -363,18 +238,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.retainAll(items);
-                    }
-                }, cctx);
-
             return delegate.retainAll(items);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -385,18 +250,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Integer>() {
-                    @Override public Integer call() throws Exception {
-                        return delegate.size();
-                    }
-                }, cctx);
-
             return delegate.size();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -407,18 +262,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.poll();
-                    }
-                }, cctx);
-
             return delegate.poll();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -429,18 +274,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.peek();
-                    }
-                }, cctx);
-
             return delegate.peek();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -451,20 +286,7 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional()) {
-                CU.outTx(new Callable<Void>() {
-                    @Override public Void call() throws Exception {
-                        delegate.clear(batchSize);
-
-                        return null;
-                    }
-                }, cctx);
-            }
-            else
-                delegate.clear(batchSize);
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
+            delegate.clear(batchSize);
         }
         finally {
             gate.leave();
@@ -476,18 +298,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Integer>() {
-                    @Override public Integer call() throws Exception {
-                        return delegate.remainingCapacity();
-                    }
-                }, cctx);
-
             return delegate.remainingCapacity();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -498,18 +310,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Integer>() {
-                    @Override public Integer call() throws Exception {
-                        return delegate.drainTo(c);
-                    }
-                }, cctx);
-
             return delegate.drainTo(c);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -520,18 +322,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Integer>() {
-                    @Override public Integer call() throws Exception {
-                        return delegate.drainTo(c, maxElements);
-                    }
-                }, cctx);
-
             return delegate.drainTo(c, maxElements);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -542,18 +334,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.remove();
-                    }
-                }, cctx);
-
             return delegate.remove();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -564,18 +346,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.element();
-                    }
-                }, cctx);
-
             return delegate.element();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -586,20 +358,7 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional()) {
-                CU.outTx(new Callable<Void>() {
-                    @Override public Void call() throws Exception {
-                        delegate.put(item);
-
-                        return null;
-                    }
-                }, cctx);
-            }
-            else
-                delegate.put(item);
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
+            delegate.put(item);
         }
         finally {
             gate.leave();
@@ -611,18 +370,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<Boolean>() {
-                    @Override public Boolean call() throws Exception {
-                        return delegate.offer(item, timeout, unit);
-                    }
-                }, cctx);
-
             return delegate.offer(item, timeout, unit);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -633,18 +382,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.take();
-                    }
-                }, cctx);
-
             return delegate.take();
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -655,18 +394,8 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional())
-                return CU.outTx(new Callable<T>() {
-                    @Override public T call() throws Exception {
-                        return delegate.poll(timeout, unit);
-                    }
-                }, cctx);
-
             return delegate.poll(timeout, unit);
         }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
-        }
         finally {
             gate.leave();
         }
@@ -677,20 +406,7 @@ public class GridCacheQueueProxy<T> implements IgniteQueue<T>, Externalizable {
         gate.enter();
 
         try {
-            if (cctx.transactional()) {
-                CU.outTx(new Callable<Void>() {
-                    @Override public Void call() throws Exception {
-                        delegate.close();
-
-                        return null;
-                    }
-                }, cctx);
-            }
-            else
-                delegate.close();
-        }
-        catch (IgniteCheckedException e) {
-            throw U.convertException(e);
+            delegate.close();
         }
         finally {
             gate.leave();


Mime
View raw message