Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-13214

.NET different behavior when using TransactionScope and ITransactions.Start

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.9
    • Component/s: platforms
    • Labels:
    • Release Note:
      .NET: Fix TransactionScope behavior with read-only cache operations

      Description

      Next code runs fine:

                  var barier = new Barrier(2);
                  var cache = Cache();
                  cache.Put(1, 1);
                  var task = Task.Factory.StartNew(() =>
                  {
                      var otherCache = Cache();
                      barier.SignalAndWait();
                      otherCache.Put(1, 10);
                      barier.SignalAndWait();
                  });
                  using (var txscp = new TransactionScope(TransactionScopeOption.Required, new TransactionOptions{IsolationLevel = IsolationLevel.Serializable}))
                  {
                      var before = cache.Get(1);
                      barier.SignalAndWait();
                      barier.SignalAndWait();
                      txscp.Complete();
                  }
                  Task.WaitAll(task);
                  barier.Dispose();
      

      When I switch to Ignite transactions I get exception:

                  using (var tx = Transactions.TxStart(TransactionConcurrency.Optimistic, TransactionIsolation.Serializable))
                  {
                      var before = cache.Get(1);
                      barier.SignalAndWait();
                      barier.SignalAndWait();
                      tx.Commit();
                  }
      
      Apache.Ignite.Core.Transactions.TransactionOptimisticException : Failed to prepare transaction (lock conflict): GridNearTxLocal [mappings=IgniteTxMappingsImpl [], 
      

      Cache is IIgnite.Cache<int, int>() and Transactions is IIgnite.GetTransactions()

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ptupitsyn Pavel Tupitsyn
                Reporter:
                gurustron Sergey Stronchinskiy
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1.5h
                  1.5h