this question is related with this one.
The problem I'm having is that our application has a bug and it leaves an unclosed transaction at SQL. I know for sure that the connection has been released with SQLFreeHandle but looks like somehow ODBC maintains the connection open to reuse it latter. As the connection remains open the transaction is not rolled back and 开发者_开发知识库I'm having a lock.
Is there a way to force ODBC to shutdown the connection and to close the underlying socket?
Thanks in advance.
It sounds like connection pooling is turned on. This article describes how it can be turned off at the driver level.
As Mark said, connection pooling is turned on.
Typically the wrappers for the sql drivers make a rollback call prior to releasing the connection back to the pool.
If you guys have written your own ODBC driver (or wrapper for it), you might consider just modifying the connection dispose/close/release code to do that rollback if there was an open transaction.
精彩评论