We have recently run into a serious issue with the JTDS driver. We were using JTDS with iBatis and were using timeouts to bail out of some long running queries. Since we were also using connection pooling this was leading to serious issues with stored procedures. The root cause of the issue on SQLServer is explained in the linked page but in short if we abort a request the connection should be considered "broken" and not returned to the pool.
When we had a timeout, we would send the cancel request to the server and then that connection would be returned to the pool. Unfortunatley SQLServer doesn't rollback the internal transactions it had created in the stored procedures and all the rest of our commands on that connection were basically stuck inside that transaction and that led to very strange deadlock like behaviors.
I have created a patch against the 1.2.5 codebase (which we are still using). It applies cleanly to 1.2.5, 1.2.7 and 1.3.0.
Log in to post a comment.