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 *