From: Геннадий З. <zab...@gm...> - 2015-09-17 14:33:02
|
I'm trying to insert to database multiple items at once via following code: using (var transaction = act.Database.BeginTransaction(System.Data.IsolationLevel.RepeatableRead)) { // inserting and updating several related entities. act.SaveChanges() // Throws exception } Exception message: lock conflict on no wait transaction deadlock update conflicts with concurrent update concurrent transaction number is 665378 A problematic query that throws is about updating the entity, that all my queries update. Using any other IsolationLevel doesn't affect the behavior. |
From: Геннадий З. <zab...@gm...> - 2015-09-17 14:38:24
|
I was wrong about IsolationLevel. If use Isolationlevel.Serializable exception message changes to: On 17 September 2015 at 17:32, Геннадий Забула <zab...@gm...> wrote: > I'm trying to insert to database multiple items at once via following code: > > using (var transaction = > act.Database.BeginTransaction(System.Data.IsolationLevel.RepeatableRead)) > { > // inserting and updating several related entities. > act.SaveChanges() // Throws exception > } > > Exception message: > lock conflict on no wait transaction > deadlock > update conflicts with concurrent update > concurrent transaction number is 665378 > > A problematic query that throws is about updating the entity, that all > my queries update. > > Using any other IsolationLevel doesn't affect the behavior. |
From: Геннадий З. <zab...@gm...> - 2015-09-17 14:38:56
|
lock conflict on no wait transaction Acquire lock for relation (<Table with simultenous updates>) failed ---> FirebirdSql.Data.Common.IscException: lock conflict on no wait transaction Acquire lock for relation (<Table with simultenous updates>) failed On 17 September 2015 at 17:38, Геннадий Забула <zab...@gm...> wrote: > I was wrong about IsolationLevel. If use Isolationlevel.Serializable > exception message changes to: > > On 17 September 2015 at 17:32, Геннадий Забула <zab...@gm...> wrote: >> I'm trying to insert to database multiple items at once via following code: >> >> using (var transaction = >> act.Database.BeginTransaction(System.Data.IsolationLevel.RepeatableRead)) >> { >> // inserting and updating several related entities. >> act.SaveChanges() // Throws exception >> } >> >> Exception message: >> lock conflict on no wait transaction >> deadlock >> update conflicts with concurrent update >> concurrent transaction number is 665378 >> >> A problematic query that throws is about updating the entity, that all >> my queries update. >> >> Using any other IsolationLevel doesn't affect the behavior. |
From: Геннадий З. <zab...@gm...> - 2015-09-17 15:57:17
|
Narrowed the problem. The cause is a multithreaded update of the same record field. Transactions, as I said don't dispatch the issue. On 17 September 2015 at 17:38, Геннадий Забула <zab...@gm...> wrote: > lock conflict on no wait transaction > Acquire lock for relation (<Table with simultenous updates>) failed > ---> FirebirdSql.Data.Common.IscException: lock conflict on no wait > transaction > Acquire lock for relation (<Table with simultenous updates>) failed > > On 17 September 2015 at 17:38, Геннадий Забула <zab...@gm...> wrote: >> I was wrong about IsolationLevel. If use Isolationlevel.Serializable >> exception message changes to: >> >> On 17 September 2015 at 17:32, Геннадий Забула <zab...@gm...> wrote: >>> I'm trying to insert to database multiple items at once via following code: >>> >>> using (var transaction = >>> act.Database.BeginTransaction(System.Data.IsolationLevel.RepeatableRead)) >>> { >>> // inserting and updating several related entities. >>> act.SaveChanges() // Throws exception >>> } >>> >>> Exception message: >>> lock conflict on no wait transaction >>> deadlock >>> update conflicts with concurrent update >>> concurrent transaction number is 665378 >>> >>> A problematic query that throws is about updating the entity, that all >>> my queries update. >>> >>> Using any other IsolationLevel doesn't affect the behavior. |
From: Jiří Č. <ji...@ci...> - 2015-09-17 17:56:27
|
On Thu, Sep 17, 2015, at 17:57, Геннадий Забула wrote: > Narrowed the problem. The cause is a multithreaded update of the same > record field. Transactions, as I said don't dispatch the issue. The advice is simple. Don't update same record (not only in .NET; anywhere, anytool). :D -- Mgr. Jiří Činčura Independent IT Specialist |