dbTalk Databases Forums  

Predicate Locking

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Predicate Locking in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Gene Wirchenko
 
Posts: n/a

Default 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.

Sincerely,

Gene Wirchenko


Reply With Quote
  #2  
Old   
Jan
 
Posts: n/a

Default Re: Predicate Locking - 05-21-2005 , 03:07 AM






Gene,

Simply create a master - detail structure and lock the master record to
prevent any access to the detail. What this requires from your applcation
is:-

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)..

HTH
Jan

"Gene Wirchenko" <genew (AT) ucantrade (DOT) com.NOTHERE> wrote

Quote:
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.

Sincerely,

Gene Wirchenko




Reply With Quote
  #3  
Old   
Stefan Wuebbe
 
Posts: n/a

Default 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...
Quote:
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.
Wouldn't delete / insert / update triggers be able to do what you want?


hth
-Stefan



--
Quote:
\_/| ------ ProLib - programmers liberty -----------------
(.. ) Our MVPs and MCPs make the Fox run....
- / See us at www.prolib.de or www.AFPages.de
-----------------------------------------------------------



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.