Hi,
        With a MS Access 97 application we use the Sapdb "Lock" statement in
transactions to manage concurrent access to the data. We use statements
like:

"LOCK (WAIT) ROW TbParam KEY Descrip = 'InvoiceNo' IN EXCLUSIVE MODE"

In this example, the field Descrip is the primary key of the table TbParam.
If you replace (WAIT) with (NOWAIT), the statement will not block and will
return an error message allowing you to detect a lock issued by someone
else. We have also chosen to work at the "uncommitted" isolation level
mainly because of the MS Access behavior with locks. With our application,
if Access crash (our dear old friend Dr. Watson...) the connection to the
database is released along with the lock.

I hope this helps,

Yves

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Ralf Schneider
Sent: 11 mars, 2002 06:01
To: [EMAIL PROTECTED]
Subject: Locking at application level


Hi,

has anyone experiences with locking database records on an application
level?

My problem:
I develop a client application on Linux. There might be several instances in
the network that access the same database. If a user opens one data item
(several records in different tables) for editing the data, this item should
be locked so that the next user that wants to edit this item gets an error
message.

I have two ideas for solving this problem: One is on database level using
locks and the other is on application level using a column where I enter the
username who locked the item.

One problem is: What happens if the client application crashes and the lock
is not removed? For the application level locking a possible solution would
be to setup a cron job that regularly checks if the usernames in the locked
records are in the table CONNECTEDUSERS yet.

Any comments?

It would be nice if someone could share his experiences with such a problem
(I don't think I'm the first who has to solve this :-).

Thanks in advance,
Ralf.
--
##     Ralf Schneider
 ##     B-connected Linux Solutions GmbH  -  Linux f�r den Mittelstand
  ##     Dennis-Gabor-Str. 2, 14469 Potsdam
   ##     www.b-connected.de
_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

_______________________________________________
sapdb.general mailing list
[EMAIL PROTECTED]
http://listserv.sap.com/mailman/listinfo/sapdb.general

Reply via email to