Re: Lock record

From: Martijn van Oosterhout <martijn(at)apex(dot)net(dot)au>
To: andrea(dot)aime(at)comune(dot)modena(dot)it
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Lock record
Date: 2000-06-14 14:10:39
Message-ID: 3947925F.104A9649@apex.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Andrea Aime wrote:
>
> Hi people. I'm writing a client application in Visual Basic,
> and I need to lock certain records (a read lock) for
> a long period of time (well, from the start just to
> the stop of my application) so that no one can modify
> them. I've seen a lock command, but it seem only capable
> to lock an entire table. I'm using ADO, and it seem possible
> to lock a record by opening a recordset on it (with a
> proper query) and keeping that recordset open (I think
> that it's the cursor that keeps the lock on the db).
> Anyone knows a different/better method?

First, locking is evil. All I achieves is make any
other client trying to access that record jam up.
If you want to handle multiple people modifying the
same record, maybe you should look into transactions...

More info maybe be needed here...

HTH,
--
Martijn van Oosterhout <kleptog(at)cupid(dot)suninternet(dot)com>
http://cupid.suninternet.com/~kleptog/

In response to

Browse pgsql-general by date

  From Date Subject
Next Message teixeira 2000-06-14 14:27:05 Re:
Previous Message Mirko Geffken 2000-06-14 14:06:08 Performance of PostgreSQL vs. Other DBs