From: Roman P. <rpa...@ak...> - 2016-10-25 19:15:15
|
Hi All, I created simple WinForms application that work with FireBird database. Database contain only one table with one record with four fields (id, firstname, secondanme, email). For emulate a real program flow I start 3 concurrent query for table. Each query update own field (first for email, second for firstname, third for lastname). After starting program I've got exception with message "lock conflict on no wait transaction". For testing purpose I changed database from FireBird to MySql and this exceptions is gone. Configuration for DbContext is the same, I just changed connection string. How I can fix this behavior for FireBird net provider and and switch it close to MySql. FireBird version: 2.5 FirebirdSql.Data.FirebirdClient: 4.10 -- Roman Patutin |
From: Jiří Č. <ji...@ci...> - 2016-10-26 04:37:25
|
When the two transactions update same record *at the same time*, there's nothing you can do it. One will fail. You can minimize that keeping the transactions as short as possible. Comparing TX handling with MySQL is wrong; I guess you used MyISAM tables, where TXs are virtually non-existent. Try any other real DB and you'll get the same problem. -- Mgr. Jiří Činčura Independent IT Specialist |
From: Roman P. <rpa...@ak...> - 2016-10-26 07:32:53
|
I added one more db connection into app. This time it was PostgreSql and Postgres worked with same behavior as MySql. I don't know is Postgres real db or not, but it allows to change different fields in one record for concurrent queries. May be I just can't correctly describe the problem. Jiri, I put archive with source code into google drive https://drive.google.com/file/d/0B8UZY3a6pO3iTkRHZ1NIQVlrS3M/view?usp=sharing . Can you review my code, may be I just lost some specific configuration part or something similar. -- Roman Patutin -----Original Message----- From: Jiří Činčura [mailto:ji...@ci...] Sent: Wednesday, October 26, 2016 7:37 AM To: fir...@li... Subject: Re: [Firebird-net-provider] EntitiyFramework and Update When the two transactions update same record *at the same time*, there's nothing you can do it. One will fail. You can minimize that keeping the transactions as short as possible. Comparing TX handling with MySQL is wrong; I guess you used MyISAM tables, where TXs are virtually non-existent. Try any other real DB and you'll get the same problem. -- Mgr. Jiří Činčura Independent IT Specialist |
From: Jiří Č. <ji...@ci...> - 2016-10-26 08:19:38
|
There's really nothing EF related. You can try it with multiple console windows with multiple transactions together. It's fundamental way how transactions work. -- Mgr. Jiří Činčura Independent IT Specialist |
From: Gerdus v. Z. <ger...@gm...> - 2016-10-26 09:28:12
|
I suspect the default transaction option might not be the same in firebird and other databases. Try setting the IsolationLevel to SERIALIZABLE on the transaction. On Wed, Oct 26, 2016 at 10:19 AM, Jiří Činčura <ji...@ci...> wrote: > There's really nothing EF related. You can try it with multiple console > windows with multiple transactions together. It's fundamental way how > transactions work. > > -- > Mgr. Jiří Činčura > Independent IT Specialist > > > ------------------------------------------------------------ > ------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > -- ------------------------------------------------------------------------ Gerdus van Zyl www.infireal.com |
From: Геннадий З. <zab...@gm...> - 2016-10-26 16:14:53
|
FB.NET doesn't wait on locks, it returns immediately with exception. All other known for me are waiting on locks. That's the behavior you observe. You need to override creation of transaction. You should use FbTransaction with TBP in which you specify waiting option and timeout. On 26 October 2016 at 12:27, Gerdus van Zyl <ger...@gm...> wrote: > I suspect the default transaction option might not be the same in firebird > and other databases. > Try setting the IsolationLevel to SERIALIZABLE on the transaction. > > On Wed, Oct 26, 2016 at 10:19 AM, Jiří Činčura <ji...@ci...> wrote: >> >> There's really nothing EF related. You can try it with multiple console >> windows with multiple transactions together. It's fundamental way how >> transactions work. >> >> -- >> Mgr. Jiří Činčura >> Independent IT Specialist >> >> >> >> ------------------------------------------------------------------------------ >> The Command Line: Reinvented for Modern Developers >> Did the resurgence of CLI tooling catch you by surprise? >> Reconnect with the command line and become more productive. >> Learn the new .NET and ASP.NET CLI. Get your free copy! >> http://sdm.link/telerik >> _______________________________________________ >> Firebird-net-provider mailing list >> Fir...@li... >> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > > > > > -- > ------------------------------------------------------------------------ > Gerdus van Zyl > www.infireal.com > > ------------------------------------------------------------------------------ > The Command Line: Reinvented for Modern Developers > Did the resurgence of CLI tooling catch you by surprise? > Reconnect with the command line and become more productive. > Learn the new .NET and ASP.NET CLI. Get your free copy! > http://sdm.link/telerik > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider > |