🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.interbase.sql
5 messages
5 total messages Started by Edward Diener Tue, 17 Dec 2002 18:13
Deadlock error
#11052
Author: Edward Diener
Date: Tue, 17 Dec 2002 18:13
4 lines
1160 bytes
What does the IB isc_deadlock error mean ? What is the difference between it
and isc_lock_conflict ? If TXA updates or deletes a record and TXB attempts
to update or delete that record before TXA has finished, what IB error
message is received in the exception ?
Re: Deadlock error
#11073
Author: T. van Rompaey
Date: Fri, 20 Dec 2002 14:42
31 lines
2167 bytes
A deadlock is when a statement (i.e. UPDATE) locks for example row 1 and
then tries to update row 2.
In the mean time another user has locked and edited row 2 and now tries to
update row 1.

So, row 1 is locked by user 1 and row 2 is locked by user 2 who are now both
waiting for the other user to release the lock.

The situation in your last sentence will (in my option) not generate a error
because the second statement will wait till the records are release from the
lock and either 1) try to delete or update a row that already is deleted (=
no problem) or 2) update or delete a row that is updated which will not
generate a database error but you should write your software to prevent
this. (i.e. check how much rows are edited / deleted after the stament and
compare this to what you expect)

Hope this helps,

Greetings,
Thomas

"Edward Diener" <eddielee@tropicsoft.com> wrote in message
news:3dff68ba$1@newsgroups.borland.com...
> What does the IB isc_deadlock error mean ? What is the difference between
it
> and isc_lock_conflict ? If TXA updates or deletes a record and TXB
attempts
> to update or delete that record before TXA has finished, what IB error
> message is received in the exception ?
>
>
Re: Deadlock error
#11076
Author: Edward Diener
Date: Fri, 20 Dec 2002 16:03
33 lines
2489 bytes
"T. van Rompaey" <tvrompaey@scabbouw.nlNOSPAM> wrote in message
news:3e032c57$1@newsgroups.borland.com...
> A deadlock is when a statement (i.e. UPDATE) locks for example row 1 and
> then tries to update row 2.
> In the mean time another user has locked and edited row 2 and now tries to
> update row 1.
>
> So, row 1 is locked by user 1 and row 2 is locked by user 2 who are now
both
> waiting for the other user to release the lock.

I didn't realize IB could detect this and generate an error. I guess this is
the isc_deadlock error.

>
> The situation in your last sentence will (in my option) not generate a
error
> because the second statement will wait till the records are release from
the
> lock and either 1) try to delete or update a row that already is deleted
(=
> no problem) or 2) update or delete a row that is updated which will not
> generate a database error but you should write your software to prevent
> this. (i.e. check how much rows are edited / deleted after the stament and
> compare this to what you expect)

From my understanding it will wait only if one uses "read_committed",
"no_rec_version", and "wait" transaction attributes or one uses
"consistency" and "wait", else an error is produced when the second
transaction attempts to delete or update the record before the first
transaction commits. I guess this error is the isc_lock_conflict.

Thanks. The two cases explain the different errors.
Re: Deadlock error
#11086
Author: Bill Todd
Date: Fri, 20 Dec 2002 22:16
8 lines
1345 bytes
A bit of additional information. There is a setting in the ibconfig
file that lets you control how long IB will wait for a lock before it
performs a deadlock scan.


--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
Re: Deadlock error
#10988
Author: Edward Diener
Date: Sat, 21 Dec 2002 02:35
7 lines
1416 bytes
OK, thanks for the info.

"Bill Todd" <bill@notthis.dbginc.com> wrote in message
news:qj570vsp6a89g6dmfst156ohlr68ig1med@4ax.com...
> A bit of additional information. There is a setting in the ibconfig
> file that lets you control how long IB will wait for a lock before it
> performs a deadlock scan.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads