Assume that you use a session that calls a common language runtime (CLR) stored procedure (a "calling session") to access data in Microsoft SQL Server, and that procedure in turn establishes a separate connection (a "second session") to the same server instead of a Context Connection. Then, if the calling session is terminated because of a time-out or cancelation, the second session may become orphaned, and will exist in the system until it is manually terminated by using the KILL command. If that orphaned session holds any locks, other sessions may be blocked waiting for the locks to be released.
Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.
This issue is fixed in the following cumulative updates for SQL Server:
- Cumulative Update 1 for SQL Server 2019
- Cumulative Update 18 for SQL Server 2017
- Cumulative Update 10 for SQL Server 2016 SP2
About cumulative updates for SQL Server:
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server
- Latest cumulative update for SQL Server 2019
- Latest cumulative update for SQL Server 2017
- Latest cumulative update for SQL Server 2016
Note By default, the fix is turned off because of the need forpreserving the legacy behavior of CLR threading in SQL Server. You only need to turn it on if your system exhibits the symptoms mentioned earlier. To enable the fix, you need to add the trace flag 6559 to server by using Database Engine Service Startup Options. Remember that this trace flag can be used only together with SQL Server startup options. It cannot be set by using the DBCC TRACEON command.