Details
-
Bug
-
Status: Resolved
-
Critical
-
Resolution: Fixed
-
None
-
.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
- links to