Predicate Locking - 05-20-2005 , 02:53 PM
Does anyone have any good pointers (links or tips) on predicate
locking? This is locking on a condition. For example, locking by
wonbr=1234 means that no one else can a) modify (including deletion or
recall) a row where wonbr=1234, b) modify a row with wonbr#1234 so
that wonbr=1234, and c) add a row with wonbr=1234.
I have considered this before, but it never got to
implementation. Maybe this time.
I am puzzled as to why this does not come up more often. It
seems to me that it must be an issue in a lot of billing applications.
Re: Predicate Locking - 05-21-2005 , 03:07 AM
Simply create a master - detail structure and lock the master record to
prevent any access to the detail. What this requires from your applcation
1. Your data structures need to support this convention
2. Your applcation has to adhere to this convention
A typical situation would be a customer invoice. If you open the invoice on
one workstation and lock the invoice header, no other users will be able to
add to the invoice, modify the existing contents of the invoice or delete
any of the detail lines on the invoice. Other users can, however, change the
customer's details, add other invoices under this customer or process other
transactions against the customer account.
So assuming wonbr is the invoice number then no one else can add invoice
1234 (already exists and is probably a sequentially generated number). As
the invoice header is locked no one else can "open" or edit the details on
the invoice (as long as your application enforces this convention)..
"Gene Wirchenko" <genew (AT) ucantrade (DOT) com.NOTHERE> wrote
Re: Predicate Locking - 05-21-2005 , 03:27 AM
"Gene Wirchenko" <genew (AT) ucantrade (DOT) com.NOTHERE> schrieb im Newsbeitrag
news:jjfs81tb331js05j7cg4e2r7rftrf4e3i5 (AT) 4ax (DOT) com...