Subject | RE: [Firebird-Java] Deadlock question |
---|---|
Author | Dave Byrne |
Post date | 2005-10-03T20:59:08Z |
Hi Roman,
Thanks for the info. I have configured P6Spy to log all the SQL and I'm
working on reproducing the problem again.
I don't think a) or b) is what is happening in this case though. I will
let you know what I see in the logs.
Dave
-----Original Message-----
From: Firebird-Java@yahoogroups.com
[mailto:Firebird-Java@yahoogroups.com] On Behalf Of Roman Rokytskyy
Sent: Friday, September 30, 2005 12:08 PM
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Deadlock question
a) SELECT ... FOR UPDATE WITH LOCK - this construction obtains a lock on
the
each record being fetched (note, this is not SQL standart conform).
b) You use READ COMMITTED isolation with NO_REC_VERSION and NOWAIT
transaction parameters. Then, if there is an uncommitted version for the
record being currently fetched, an error is returned.
In all other cases no lock conflict should be reported, but an old
record
version should be used.
statements were executed, so you can check whethere there can be a
conflict
or not.
Roman
Yahoo! Groups Links
Thanks for the info. I have configured P6Spy to log all the SQL and I'm
working on reproducing the problem again.
I don't think a) or b) is what is happening in this case though. I will
let you know what I see in the logs.
Dave
-----Original Message-----
From: Firebird-Java@yahoogroups.com
[mailto:Firebird-Java@yahoogroups.com] On Behalf Of Roman Rokytskyy
Sent: Friday, September 30, 2005 12:08 PM
To: Firebird-Java@yahoogroups.com
Subject: Re: [Firebird-Java] Deadlock question
> The second one happens everyone once in a while when I have aexception
> multi-threaded client running against the database. *Every* time it
> occurs, a SQL SELECT query is being executed (although there are
> potentially other update operations in the transaction). The
> message just says "deadlock". I could add instrumentation to see whatto
> happened during the failed transaction, but what I would really like
> find out is, what happened during the conflicting transaction that wasThere are two possibilities for a lock conflict during SELECT:
> allowed to succeed.
a) SELECT ... FOR UPDATE WITH LOCK - this construction obtains a lock on
the
each record being fetched (note, this is not SQL standart conform).
b) You use READ COMMITTED isolation with NO_REC_VERSION and NOWAIT
transaction parameters. Then, if there is an uncommitted version for the
record being currently fetched, an error is returned.
In all other cases no lock conflict should be reported, but an old
record
version should be used.
> So my question is, what is the best way to debug something like this.I am using P6Spy together with IronTrack SQL, there you can see what
> And also, is there any significance to the fact that the text of the
> exception messages is different
statements were executed, so you can check whethere there can be a
conflict
or not.
Roman
Yahoo! Groups Links