Re: Multithreaded ODBC SP call locking problem

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
On Wed, 16 Feb 2011 12:55:25 +0000
Matthew Gates <[email protected]> wrote:

> We can see SQL Server sending the output parameter over the network, so we're sure the SP is complete, but the program doesn't seem to send back the SQLEndTran request.  

What does "send back the SQLEndTran request" mean?  That the function never returns (even though the protocol trace seems to indicate it should)?  

> freetds-0.62.4  (I know, I'm sorry, it's very old.  Not my choice!)

One thing I can tell you is that the network timeout logic was re-written since then to make cancels work.  I'm not saying upgrading will solve all your troubles, but that would be in the same vicinity.  

Look at src/odbc/odbc.c::change_transaction, which is called by SQLEndTran().  Consider the impact of the thread-safety issues there.  Maybe add some log instrumentation.  It's also clear the current implementation (and surely 0.62 too) masks errors by not returning SQL_SUCCESS_WITH_INFO when it should.  

HTH.

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.