FIREDAC ODBC SQL Server driver connection is busy causing another hstmt

Source: Internet
Author: User
Tags sql server driver odbc sql server driver

FIREDAC ODBC SQL Server driver connection is busy causing another hstmt

This error is likely to occur because the database has a deadlock.

Workaround: Clean up the deadlock.

Attach the stored procedure that MSSQL cleans up the deadlock and execute the stored procedure when the deadlock occurs:

SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS on
GO


-- =============================================
--Author:<author,,name>
--Create Date: <create date,,>
--Description: Clear the deadlock
-- =============================================
CREATE PROCEDURE [dbo]. [Sp_clear_dead_lock]
As
BEGIN
Exec Dbo.sp_lock begin DECLARE @i int--define the thread ID to purge
declare @SQL nvarchar (3000);
Set @i = 0; while (@i<10000) Begin-Clears all occupied threads
Set @SQL =n ' kill ' +convert (varchar), @i
exec sp_executesql @SQL;
Set @[email protected]+1; End End
End


GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS on
GO

FIREDAC ODBC SQL Server driver connection is busy causing another hstmt

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.