Re: row-level locking
От | Muhammad Shariq |
---|---|
Тема | Re: row-level locking |
Дата | |
Msg-id | 20030403063535.89040.qmail@web41107.mail.yahoo.com обсуждение исходный текст |
Ответ на | row-level locking (Markus Wagner <wagner@imbei.uni-mainz.de>) |
Список | pgsql-general |
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@imbei.uni-mainz.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
В списке pgsql-general по дате отправления: