db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendle...@amberpoint.com>
Subject Re: Auto-increment values, nested transactions & locks...
Date Mon, 03 Mar 2008 19:43:47 GMT
 > My question is basically - why does the nested-transaction need to fail
 > immediately if it encounters a lock?

It may be because the code is concerned that it is the parent transaction
itself which holds the lock, and if we waited for the lock we'd have a
self deadlock which would never be resolved.

That is:
  - parent transaction does something which causes it to hold a lock on
    the system table.
  - parent transaction initiates a nested transaction which needs to lock
    the system table.
  - nested transaction can't get the lock, blocks waiting for it.
  - parent transaction never proceeds, because it's waiting for the
    nested transaction.

thanks,

bryan




Mime
View raw message