Skip to Content.
Sympa Menu

freetds - Re: [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: Re: [freetds] "Select with(updlock)" and subsequent "update"
  • Date: Thu, 08 Dec 2005 22:54:17 +0000

Ignore my previous post, it's doable using one single connection. The row lock still remains if I do a SQL_CLOSE on the first statement, then I can issue the subsecquent update on the same connection.



[freetds] "Select with(updlock)" and subsequent "update"
cui yanxin cuiyanxin at hotmail.com
Mon Dec 5 20:22:09 EST 2005

Previous message: [freetds] freebcp file limit
Next message: [freetds] freebcp file limit
Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

--------------------------------------------------------------------------------

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

_________________________________________________________________
Don't just search. Find. Check out the new MSN Search! http://search.msn.com/





Archive powered by MHonArc 2.6.24.

Top of Page