From: | Muhammad Shariq <shariq77(at)yahoo(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: row-level locking |
Date: | 2003-04-03 06:35:35 |
Message-ID: | 20030403063535.89040.qmail@web41107.mail.yahoo.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-odbc |
All you have to do is to call the BeginTrans method of
the Connecion object of ADO in VB using ODBC.
While in transaction mode you can lock as many rows as
you want using "Select .... For Update" query but
remember that if the row is already locked by some
other user/client, all the rows locked by your
transaction will be automatically rolledback. To
release the locked rows you can either call the
RollbackTrans or CommitTrans method of the Connection
object.
--- Markus Wagner <wagner(at)imbei(dot)uni-mainz(dot)de> wrote:
> Hi,
>
> we need to prevent write access for a single row of
> a table for a short time.
>
> We found a short description for the "SELECT FOR
> UPDATE" statement:
> "perform exclusive locking of selected rows"
>
> Now my question: Is this a good method for our
> purpose?
>
> Assuming that we lock our row with
> "SELECT FOR UPDATE FROM <table> WHERE <our
> condition>",
> how can we unlock it later?
>
> Do we have to put the whole thing in a transaction
> (which may be tricky from
> within a VB-Application...)?
>
> Thanks a lot,
> Markus
>
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html
__________________________________________________
Yahoo! Plus
For a better Internet experience
http://www.yahoo.co.uk/btoffer
From | Date | Subject | |
---|---|---|---|
Next Message | Jean-Christian Imbeault | 2003-04-03 06:40:42 | Re: unable to dump database, toast errors |
Previous Message | Sean Chittenden | 2003-04-03 06:29:08 | Re: pgsql password when FreeBSD boots -- what's usual? |
From | Date | Subject | |
---|---|---|---|
Next Message | Chris Gamache | 2003-04-03 14:04:10 | Re: problem after upgrade --- (U/D) |
Previous Message | Jeff Silberberg | 2003-04-02 21:46:15 | Re: problem after upgrade --- (U/D) |