HP3000-L Archives

August 2004, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ken Hirsch <[log in to unmask]>
Reply To:
Ken Hirsch <[log in to unmask]>
Date:
Sun, 22 Aug 2004 16:35:31 -0400
Content-Type:
text/plain
Parts/Attachments:
text/plain (39 lines)
Wirt Atmar wrote:

>Jim asks:
>
>
>
> <>
> I realize that the sequence of events outlined above is just an
> outline and
> not an accurate representation of the code, but as it stands, there
> are not nearly enough UNLOCK's in the sequence listed above.
>
You only need one unlock per database.  IMAGE uses strict two-phase locking.

> <>But perhaps more importantly, the DBXEND and DBUNLOCK commands listed in
> steps 8 & 9 seem out of order. Without having ever studied the
> DBXBEGIN/DBXEND
> process in detail, my intuition is that these two steps should probably be
> reversed, if that list is an accurate representation of what actually
> is occurring.


No, you have to DBXEND before you UNLOCK.  A transaction without a
DBXEND has to be rolled back and you can't roll back a transaction
without holding the locks.  (Clearly you have to DBXUNDO while you still
hold the locks.)  In a relational database, the COMMIT WORK and ROLLBACK
WORK release the locks as well as ending the transaction.  One might
argue that DBXEND/DBXUNDO should, but I imagine that consideration
involving multiple databases and/or backwards compatibility ruled that out.

The only comment I have about the original sequence is this: although
Image does not enforce it, you must hold a lock before you read, not
just before you write.  Otherwise there can be serious logical errors
(dirty read/lost update/non-repeateable read).
.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2