You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2016/12/28 14:07:18 UTC

ignite git commit: IGNITE-4504 .NET: Expose default transaction settings on ITransactions

Repository: ignite
Updated Branches:
  refs/heads/master 864af7eb4 -> 828b9b614


IGNITE-4504 .NET: Expose default transaction settings on ITransactions


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

Branch: refs/heads/master
Commit: 828b9b614ba23d8316c8f0db173a2dc09a5bda27
Parents: 864af7e
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Wed Dec 28 17:06:57 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Wed Dec 28 17:06:57 2016 +0300

----------------------------------------------------------------------
 .../Cache/CacheAbstractTransactionalTest.cs      |  9 +++++++++
 .../Impl/Transactions/TransactionsImpl.cs        | 18 ++++++++++++++++++
 .../Transactions/ITransactions.cs                | 19 ++++++++++++++++++-
 3 files changed, 45 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
index e836ba2..5dcc560 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/CacheAbstractTransactionalTest.cs
@@ -399,6 +399,15 @@ namespace Apache.Ignite.Core.Tests.Cache
             Assert.AreEqual(TransactionIsolation.RepeatableRead, tx.Isolation);
             Assert.AreEqual(2500, tx.Timeout.TotalMilliseconds);
             Assert.AreEqual(startTime3, tx.StartTime);
+
+            // Check defaults.
+            tx = Transactions.TxStart();
+
+            Assert.AreEqual(Transactions.DefaultTransactionConcurrency, tx.Concurrency);
+            Assert.AreEqual(Transactions.DefaultTransactionIsolation, tx.Isolation);
+            Assert.AreEqual(Transactions.DefaultTimeout, tx.Timeout);
+
+            tx.Commit();
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
index 6f8e5bf..5fa5db8 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Impl/Transactions/TransactionsImpl.cs
@@ -158,6 +158,24 @@ namespace Apache.Ignite.Core.Impl.Transactions
             DoOutInOp(OpResetMetrics);
         }
 
+        /** <inheritDoc /> */
+        public TransactionConcurrency DefaultTransactionConcurrency
+        {
+            get { return _dfltConcurrency; }
+        }
+
+        /** <inheritDoc /> */
+        public TransactionIsolation DefaultTransactionIsolation
+        {
+            get { return _dfltIsolation; }
+        }
+
+        /** <inheritDoc /> */
+        public TimeSpan DefaultTimeout
+        {
+            get { return _dfltTimeout; }
+        }
+
         /// <summary>
         /// Commit transaction.
         /// </summary>

http://git-wip-us.apache.org/repos/asf/ignite/blob/828b9b61/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
index ddd2b21..d3b98da 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core/Transactions/ITransactions.cs
@@ -28,7 +28,9 @@ namespace Apache.Ignite.Core.Transactions
     public interface ITransactions
     {
         /// <summary>
-        /// Starts a transaction with default isolation, concurrency, timeout, and invalidation policy.
+        /// Starts a transaction with default isolation (<see cref="DefaultTransactionIsolation"/>, 
+        /// concurrency (<see cref="DefaultTransactionConcurrency"/>), timeout (<see cref="DefaultTimeout"/>), 
+        /// and invalidation policy.
         /// All defaults are set in CacheConfiguration at startup.
         /// </summary>
         /// <returns>New transaction.</returns>
@@ -62,6 +64,21 @@ namespace Apache.Ignite.Core.Transactions
         ITransaction Tx { get; }
 
         /// <summary>
+        /// Gets the default transaction concurrency.
+        /// </summary>
+        TransactionConcurrency DefaultTransactionConcurrency { get; }
+        
+        /// <summary>
+        /// Gets the default transaction isolation.
+        /// </summary>
+        TransactionIsolation DefaultTransactionIsolation { get; }
+
+        /// <summary>
+        /// Gets the default transaction timeout.
+        /// </summary>
+        TimeSpan DefaultTimeout { get; }
+
+        /// <summary>
         /// Gets the metrics.
         /// </summary>
         [SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate",