Re: [Firebird-net-provider] Multithread insert

2015-09-20 Thread Геннадий Забула
I don't think that the issue in the .NET provider. It just forwards
options to fbembed.dll for transactions it just TPB. And do it right.
The problem is in the engine, I've retested it with C API and the
behavior is similar to observed. My case is similar to the described
here: http://www.firebirdfaq.org/faq109/. With just one difference:
values field updated to is not depends on each other. I just update
the same field from several threads. I've crutched this with skipping
the exception because consistency is not a concern for this field. But
IMO, there is an issue in the engine.

On 20 September 2015 at 14:03, LtColRDSChauhan <rdsc1...@gmail.com> wrote:
>> Message: 3
>> Date: Thu, 17 Sep 2015 19:56:20 +0200
>> From: Ji?? ?in?ura <j...@cincura.net>
>> Subject: Re: [Firebird-net-provider] Multithread insert
>> To: "For users and developers of the Firebird .NET providers"
>> <firebird-net-provider@lists.sourceforge.net>
>> Message-ID:
>> <1442512580.927417.386542585.69829...@webmail.messagingengine.com>
>> Content-Type: text/plain; charset="UTF-8"
>>
>> 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
>>
> Transactions issues in .NET Provider  need to be addressed.
> Multithread/parallel programming and transactions enable correct
> exploitation of multicore machines.  I understand Firebird 3.0 takes major
> advances in this area.
>
>
> --
>
> ___
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-20 Thread LtColRDSChauhan
>
> Message: 3
> Date: Thu, 17 Sep 2015 19:56:20 +0200
> From: Ji?? ?in?ura <j...@cincura.net>
> Subject: Re: [Firebird-net-provider] Multithread insert
> To: "For users and developers of the Firebird .NET providers"
> <firebird-net-provider@lists.sourceforge.net>
> Message-ID:
> <1442512580.927417.386542585.69829...@webmail.messagingengine.com>
> Content-Type: text/plain; charset="UTF-8"
>
> 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
>
> Transactions issues in .NET Provider  need to be addressed.
Multithread/parallel programming and transactions enable correct
exploitation of multicore machines.  I understand Firebird 3.0 takes major
advances in this area.
--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-20 Thread Alexander Muylaert-Gelein
I don't think there is even an issue here.  inside two different transactions, 
you simply cannot update the same record.  Who would win in the end and what 
would be the end result.  I'm pretty sure if you can solve this, the firebird 
team would gladly implement this.
a

> Date: Sun, 20 Sep 2015 14:12:25 +0300
> From: zabulu...@gmail.com
> To: firebird-net-provider@lists.sourceforge.net
> Subject: Re: [Firebird-net-provider] Multithread insert
> 
> I don't think that the issue in the .NET provider. It just forwards
> options to fbembed.dll for transactions it just TPB. And do it right.
> The problem is in the engine, I've retested it with C API and the
> behavior is similar to observed. My case is similar to the described
> here: http://www.firebirdfaq.org/faq109/. With just one difference:
> values field updated to is not depends on each other. I just update
> the same field from several threads. I've crutched this with skipping
> the exception because consistency is not a concern for this field. But
> IMO, there is an issue in the engine.
> 
> On 20 September 2015 at 14:03, LtColRDSChauhan <rdsc1...@gmail.com> wrote:
> >> Message: 3
> >> Date: Thu, 17 Sep 2015 19:56:20 +0200
> >> From: Ji?? ?in?ura <j...@cincura.net>
> >> Subject: Re: [Firebird-net-provider] Multithread insert
> >> To: "For users and developers of the Firebird .NET providers"
> >> <firebird-net-provider@lists.sourceforge.net>
> >> Message-ID:
> >> <1442512580.927417.386542585.69829...@webmail.messagingengine.com>
> >> Content-Type: text/plain; charset="UTF-8"
> >>
> >> 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
> >>
> > Transactions issues in .NET Provider  need to be addressed.
> > Multithread/parallel programming and transactions enable correct
> > exploitation of multicore machines.  I understand Firebird 3.0 takes major
> > advances in this area.
> >
> >
> > --
> >
> > ___
> > Firebird-net-provider mailing list
> > Firebird-net-provider@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
> >
> 
> --
> ___
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
  --
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-20 Thread Геннадий Забула
> I don't think there is even an issue here
After taking another view at what happens, I don't think either.

The exception is thrown when similar updates are made for one field,
from several threads, when NO_WAIT specified. Only this flag causes it
to throw. No matter if you specify flags consistent or concurrency. As
I understood this is expected behavior.

NO_WAIT flag is set for any IsolationLevel specified for a
FbTransaction. The behavior of such updates is different from MSSQL
provider (it waits) and discovering this was a kind frustrating and
resulted in this thread.


On 20 September 2015 at 16:30, Alexander Muylaert-Gelein
<amuylaert_gel...@hotmail.com> wrote:
> I don't think there is even an issue here.  inside two different
> transactions, you simply cannot update the same record.  Who would win in
> the end and what would be the end result.  I'm pretty sure if you can solve
> this, the firebird team would gladly implement this.
>
> a
>
>
>> Date: Sun, 20 Sep 2015 14:12:25 +0300
>> From: zabulu...@gmail.com
>> To: firebird-net-provider@lists.sourceforge.net
>
>> Subject: Re: [Firebird-net-provider] Multithread insert
>>
>> I don't think that the issue in the .NET provider. It just forwards
>> options to fbembed.dll for transactions it just TPB. And do it right.
>> The problem is in the engine, I've retested it with C API and the
>> behavior is similar to observed. My case is similar to the described
>> here: http://www.firebirdfaq.org/faq109/. With just one difference:
>> values field updated to is not depends on each other. I just update
>> the same field from several threads. I've crutched this with skipping
>> the exception because consistency is not a concern for this field. But
>> IMO, there is an issue in the engine.
>>
>> On 20 September 2015 at 14:03, LtColRDSChauhan <rdsc1...@gmail.com> wrote:
>> >> Message: 3
>> >> Date: Thu, 17 Sep 2015 19:56:20 +0200
>> >> From: Ji?? ?in?ura <j...@cincura.net>
>> >> Subject: Re: [Firebird-net-provider] Multithread insert
>> >> To: "For users and developers of the Firebird .NET providers"
>> >> <firebird-net-provider@lists.sourceforge.net>
>> >> Message-ID:
>> >> <1442512580.927417.386542585.69829...@webmail.messagingengine.com>
>> >> Content-Type: text/plain; charset="UTF-8"
>> >>
>> >> 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
>> >>
>> > Transactions issues in .NET Provider need to be addressed.
>> > Multithread/parallel programming and transactions enable correct
>> > exploitation of multicore machines. I understand Firebird 3.0 takes
>> > major
>> > advances in this area.
>> >
>> >
>> >
>> > --
>> >
>> > ___
>> > Firebird-net-provider mailing list
>> > Firebird-net-provider@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>> >
>>
>>
>> --
>> ___
>> Firebird-net-provider mailing list
>> Firebird-net-provider@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>
> --
>
> ___
> Firebird-net-provider mailing list
> Firebird-net-provider@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/firebird-net-provider
>

--
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-17 Thread Геннадий Забула
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, Геннадий Забула  wrote:
> lock conflict on no wait transaction
> Acquire lock for relation () failed
> ---> FirebirdSql.Data.Common.IscException: lock conflict on no wait
> transaction
> Acquire lock for relation () failed
>
> On 17 September 2015 at 17:38, Геннадий Забула  wrote:
>> I was wrong about IsolationLevel. If use Isolationlevel.Serializable
>> exception message changes to:
>>
>> On 17 September 2015 at 17:32, Геннадий Забула  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.

--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991=/4140
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-17 Thread Геннадий Забула
lock conflict on no wait transaction
Acquire lock for relation () failed
---> FirebirdSql.Data.Common.IscException: lock conflict on no wait
transaction
Acquire lock for relation () failed

On 17 September 2015 at 17:38, Геннадий Забула  wrote:
> I was wrong about IsolationLevel. If use Isolationlevel.Serializable
> exception message changes to:
>
> On 17 September 2015 at 17:32, Геннадий Забула  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.

--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991=/4140
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider


Re: [Firebird-net-provider] Multithread insert

2015-09-17 Thread Jiří Činčura
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

--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991=/4140
___
Firebird-net-provider mailing list
Firebird-net-provider@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/firebird-net-provider