If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > Recordlock

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-12-04, 04:47
Zore Zore is offline
Registered User
 
Join Date: May 2004
Posts: 1
Cool Recordlock

Hi all
I am working with Pervasive 2000i. I'm using client Interface Engine to connect to server.I want to lock a record if one of the users is busy working with it. When 2nd users edit client he should not be able to edit client.

My idea was to use the DtoSqlClient collection that you can use to connect to server. I want to use a txt file to list all active users while users are logged on and with what client it is busy with. As soon as comp freezes or he logs out - Conn will not be active anymore and user will be deleted from txt file and client is available for next user to edit.
Timer will refresh active users keep txt file updated

When you use ODBC Engine Interface you are able to see active users but not with ODBC Client Engine.

1. Is this a good way to test for active users with a record or are there any other ways to see what users are using what records.
Reply With Quote
  #2 (permalink)  
Old 05-12-04, 22:49
sundialsvcs sundialsvcs is offline
Registered User
 
Join Date: Oct 2003
Posts: 706
What you are asking for is "pessimistic locking" and in an SQL database that's almost never done.

Consult Google.
__________________
ChimneySweep(R): fast, automatic
table repair at a click of the
mouse! http://www.sundialservices.com
Reply With Quote
  #3 (permalink)  
Old 05-28-04, 15:33
Dilyias Dilyias is offline
Registered User
 
Join Date: Feb 2004
Posts: 78
An easy way is to open the recordset exclusively and keep it open - this is a bad idea.

A better (but a bit more code of course) would be to implement the locking in the application itself. Use a flag to indicate if that "part" of the data is "in use" by another user and prevent another client from accessing it. You could then offer to "override lock, etc.." if need-be.

Eric
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On