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

cui yanxin cuiyanxin at hotmail.com
Mon Dec 5 20:22:09 EST 2005


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/



More information about the FreeTDS mailing list