[ 
https://issues.apache.org/jira/browse/IGNITE-13214?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sergey Stronchinskiy updated IGNITE-13214:
------------------------------------------
    Description: 
Next code runs fine:

{code:c#}
            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();
{code}

When I switch to Ignite transactions I get exception:

{code:c#}
            using (var tx = 
Transactions.TxStart(TransactionConcurrency.Optimistic, 
TransactionIsolation.Serializable))
            {
                var before = cache.Get(1);
                barier.SignalAndWait();
                barier.SignalAndWait();
                tx.Commit();
            }
{code}

{noformat}
Apache.Ignite.Core.Transactions.TransactionOptimisticException : Failed to 
prepare transaction (lock conflict): GridNearTxLocal 
[mappings=IgniteTxMappingsImpl [], 
{noformat}

_Cache_ is _IIgnite.Cache<int, int>()_  and _Transactions_ is 
_IIgnite.GetTransactions()_

  was:
Next code runs fine:

{code:c#}
            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();
{code}

When I switch to Ignite transactions I get exception:

{code:c#}
            using (var tx = 
Transactions.TxStart(TransactionConcurrency.Optimistic, 
TransactionIsolation.Serializable))
            {
                var before = cache.Get(1);
                barier.SignalAndWait();
                barier.SignalAndWait();
                tx.Commit();
            }
{code}

{noformat}
Apache.Ignite.Core.Transactions.TransactionOptimisticException : Failed to 
prepare transaction (lock conflict): GridNearTxLocal 
[mappings=IgniteTxMappingsImpl [], 
{noformat}

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


> .NET different behavior when using TransactionScope and  ITransactions.Start
> ----------------------------------------------------------------------------
>
>                 Key: IGNITE-13214
>                 URL: https://issues.apache.org/jira/browse/IGNITE-13214
>             Project: Ignite
>          Issue Type: Bug
>          Components: platforms
>            Reporter: Sergey Stronchinskiy
>            Priority: Critical
>              Labels: .NET, transactions
>
> Next code runs fine:
> {code:c#}
>             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();
> {code}
> When I switch to Ignite transactions I get exception:
> {code:c#}
>             using (var tx = 
> Transactions.TxStart(TransactionConcurrency.Optimistic, 
> TransactionIsolation.Serializable))
>             {
>                 var before = cache.Get(1);
>                 barier.SignalAndWait();
>                 barier.SignalAndWait();
>                 tx.Commit();
>             }
> {code}
> {noformat}
> Apache.Ignite.Core.Transactions.TransactionOptimisticException : Failed to 
> prepare transaction (lock conflict): GridNearTxLocal 
> [mappings=IgniteTxMappingsImpl [], 
> {noformat}
> _Cache_ is _IIgnite.Cache<int, int>()_  and _Transactions_ is 
> _IIgnite.GetTransactions()_



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to