Results 1 to 3 of 3

Thread: Recordlock

  1. #1
    Join Date
    May 2004

    Cool Unanswered: 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.

  2. #2
    Join Date
    Oct 2003
    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

  3. #3
    Join Date
    Feb 2004
    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts