Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 3 of 3 total
Thread pessimistic locking and exception handling
Sun, Feb 17 2008 5:55 PMPermanent Link

Steve Barker
Hi,

Can someone please point me to a good example of exception handling for the pessimistic
locking protocol?

Is it best to handle this in the application.onexception or on every table's
onediterror/ondeleteerror?

I usually use optimistic locking but this customer wants his master record locked while
child tables are being edited. It is a complex system with about 20 different
child/grandchild tables below the master.

thanks,
Steve
Mon, Feb 18 2008 3:46 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Can someone please point me to a good example of exception handling for
the pessimistic locking protocol? >>

There's some examples in the manual:

http://www.elevatesoft.com/scripts/manual.dll?action=mantopic&id=dbisam4&product=d&version=7&category=1&topic=30

<< Is it best to handle this in the application.onexception or on every
table's onediterror/ondeleteerror? >>

The only way to handle it and have a recourse/response to the issue is to
use the OnEditError/OnDeleteError event handlers.   With
Application.OnException, you only have the option of displaying an error
message.

<< I usually use optimistic locking but this customer wants his master
record locked while child tables are being edited. It is a complex system
with about 20 different child/grandchild tables below the master. >>

I can see why he wants the master locked in that case - no one wants to weed
through that many levels and re-check the updates if something can't be
locked or has been updated since the last read.

--
Tim Young
Elevate Software
www.elevatesoft.com

Mon, Feb 18 2008 11:37 PMPermanent Link

Steve Barker
Thanks Tim.
I found I already had some similar code, but for some reason I thought there was more to it.
Image