ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From voze...@apache.org
Subject [39/50] ignite git commit: wip
Date Mon, 18 Jan 2016 14:12:44 GMT
wip


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

Branch: refs/heads/ignite-2324
Commit: 9edb32f7e3e4262bd3a71b93c3dd93d696b2e9bd
Parents: 41ae014
Author: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Authored: Thu Jan 14 11:48:47 2016 +0300
Committer: Pavel Tupitsyn <ptupitsyn@gridgain.com>
Committed: Thu Jan 14 11:48:47 2016 +0300

----------------------------------------------------------------------
 .../Apache.Ignite.Core/Impl/Cache/CacheImpl.cs  | 43 ++++++++++++--------
 1 file changed, 26 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/9edb32f7/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs
index dbb58c8..325d429 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Cache/CacheImpl.cs
@@ -1000,36 +1000,45 @@ namespace Apache.Ignite.Core.Impl.Cache
         /// <summary>
         /// QueryContinuous implementation.
         /// </summary>
-        private IContinuousQueryHandle<ICacheEntry<TK, TV>> QueryContinuousImpl(ContinuousQuery<TK,
TV> qry, 
+        private IContinuousQueryHandle<ICacheEntry<TK, TV>> QueryContinuousImpl(ContinuousQuery<TK,
TV> qry,
             QueryBase initialQry)
         {
             qry.Validate();
 
             var hnd = new ContinuousQueryHandleImpl<TK, TV>(qry, Marshaller, _flagKeepBinary);
 
-            using (var stream = IgniteManager.Memory.Allocate().GetStream())
+            try
             {
-                var writer = Marshaller.StartMarshal(stream);
-
-                hnd.Start(_ignite, writer, () =>
+                using (var stream = IgniteManager.Memory.Allocate().GetStream())
                 {
-                    if (initialQry != null)
+                    var writer = Marshaller.StartMarshal(stream);
+
+                    hnd.Start(_ignite, writer, () =>
                     {
-                        writer.WriteInt((int) initialQry.OpId);
+                        if (initialQry != null)
+                        {
+                            writer.WriteInt((int) initialQry.OpId);
 
-                        initialQry.Write(writer, IsKeepBinary);
-                    }
-                    else
-                        writer.WriteInt(-1); // no initial query
+                            initialQry.Write(writer, IsKeepBinary);
+                        }
+                        else
+                            writer.WriteInt(-1); // no initial query
 
-                    FinishMarshal(writer);
+                        FinishMarshal(writer);
 
-                    // ReSharper disable once AccessToDisposedClosure
-                    return UU.CacheOutOpContinuousQuery(Target, (int)CacheOp.QryContinuous,
stream.SynchronizeOutput());
-                }, qry);
-            }
+                        // ReSharper disable once AccessToDisposedClosure
+                        return UU.CacheOutOpContinuousQuery(Target, (int) CacheOp.QryContinuous,
+                            stream.SynchronizeOutput());
+                    }, qry);
+                }
 
-            return hnd;
+                return hnd;
+            }
+            catch (Exception)
+            {
+                hnd.Dispose();
+                throw;
+            }
         }
 
         #endregion


Mime
View raw message