Skip to Content.
Sympa Menu

freetds - [freetds] "Select with(updlock)" and subsequent "update"

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "cui yanxin" <cuiyanxin AT hotmail.com>
  • To: FreeTDS AT lists.ibiblio.org
  • Subject: [freetds] "Select with(updlock)" and subsequent "update"
  • Date: Tue, 06 Dec 2005 01:22:09 +0000

Hi Guys,

This question is related to the question(multiple active statements on one connection) I posted several days ago. Is it a way to do 'select ... with(updlock)', then do a 'update' on the row being locked? Since we are not able to use multiple active statements on one connection, we can not do a update, a dead lock seems occur if I use two connections. Any work around?

e.g.

SQLExecDirect( hstmt1, "select employeeid,firstname from employee with(updlock) where employeeid=1", SQL_NTS);
SQLFetch( hstmt1);
.../* processing the record */
SQLExecDirect(hstmt2, "update employee set firstname='test1' where employeeid=1", SQL_NTS);

Then a deak lock happens because we are using two connections.

Thanks

Yanxin

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





Archive powered by MHonArc 2.6.24.

Top of Page