Home > database >  How to take the initiative to call sp_reset_connection
How to take the initiative to call sp_reset_connection

Time:11-19

Recent positioning to a problem, the server call a stored procedure, the stored procedure to open the transaction, but before the transaction commit/rollback, was ruled by the server for a timeout, take the initiative to close off the connection,
Then the database will have a idle process will not be clean, and lock the resources cannot be freed,
By the query, by calling the sp_reset_connection system storage process, the initiative for the database to release the process, but didn't find a way to invoke the stored procedure everywhere,
Direct execution suggest name is invalid,

Hope bosses told that other processing method,

CodePudding user response:

Oh, oh, think of, in fact, can be directly select @ @ spid before the close, then kill off

CodePudding user response:

Server is a c + +, using ado. DLL, directly in the close () calls before
Sp_reset_connection exe_command (" ");
After the database without extra idle thread, the corresponding table has not been locked,
  • Related