Subject | Re: [Firebird-Java] Re: Deadlocks in test application |
---|---|
Author | Mark Rotteveel |
Post date | 2010-04-03T12:11:41Z |
On 2-4-2010 23:58, Roman Rokytskyy wrote:
situation is where two (or more) actors (threads/connections) wait on
each other to release a resource they need to continue (and then to
release all their resources).
Eg:
Actor 1 has a lock on resource 1 and needs a lock on resource 2 to continue
Actor 2 has a lock on resource 2 and needs a lock on resource 1 to continue
=> Deadlock.
The case mentioned in this discussion is a concurrent modification or
transaction isolation issue, not deadlock (because the first actor can
continue):
Situation:
Actor 1 modifies resource 1
Actor 2 wants to modify resource 1
=> Actor 1 succeeds, actor 2 fails because of the modification already
done by actor 1
--
Mark Rotteveel
> But in general there is no single recommended procedure, as it dependsCalling this situation a deadlock is incorrect. A deadlock is a
> on your application logic. You can, for example, change the transaction
> parameters to nowait and get exception right when a deadlock is
> detected. In this case you might do something else in case of deadlock.
situation is where two (or more) actors (threads/connections) wait on
each other to release a resource they need to continue (and then to
release all their resources).
Eg:
Actor 1 has a lock on resource 1 and needs a lock on resource 2 to continue
Actor 2 has a lock on resource 2 and needs a lock on resource 1 to continue
=> Deadlock.
The case mentioned in this discussion is a concurrent modification or
transaction isolation issue, not deadlock (because the first actor can
continue):
Situation:
Actor 1 modifies resource 1
Actor 2 wants to modify resource 1
=> Actor 1 succeeds, actor 2 fails because of the modification already
done by actor 1
--
Mark Rotteveel