Have you tried profiling on the SQL Server side, to see what is happening with your SPID?
Also, I have not used freeodbc++, but maybe there is a PRINT statement in there that it does not like. You could also SET NOCOUNT ON to suppress the row count messages. Again, this depends upon how freeodbc++ reacts to these "informational" messages.
It sounds like a bug in freeodbc++, based on this "freezing" style of behavior that you describe. Start with examining the process on the SQL side to see if it is really hung, or if your library just "died" on you.
Run the procedure from query analyzer and see what happens. You can use the RAISERROR() function in the procedure to provide tracing information back to the message window to help you debug.
Adding "::Sleep(30000);" immediately after I call execute on the ODBC statement object (and before the statement close command) keeps the server process from exiting prematurely. Must be a bug with freeodbc++ or a configuration error on my part.
发布评论
评论(4)
您是否尝试过在 SQL Server 端进行分析,看看您的 SPID 发生了什么?
另外,我没有使用过 freeodbc++,但也许其中有一个它不喜欢的 PRINT 语句。 您还可以 SET NOCOUNT ON 来抑制行计数消息。 同样,这取决于 freeodbc++ 对这些“信息性”消息的反应。
基于您描述的这种“冻结”行为风格,这听起来像是 freeodbc++ 中的一个错误。 首先检查 SQL 端的进程,看看它是否真的挂起,或者您的库是否只是“死掉”了。
Have you tried profiling on the SQL Server side, to see what is happening with your SPID?
Also, I have not used freeodbc++, but maybe there is a PRINT statement in there that it does not like. You could also SET NOCOUNT ON to suppress the row count messages. Again, this depends upon how freeodbc++ reacts to these "informational" messages.
It sounds like a bug in freeodbc++, based on this "freezing" style of behavior that you describe. Start with examining the process on the SQL side to see if it is really hung, or if your library just "died" on you.
从查询分析器运行该过程,看看会发生什么。 您可以在过程中使用 RAISERROR() 函数将跟踪信息提供回消息窗口以帮助您进行调试。
Run the procedure from query analyzer and see what happens. You can use the RAISERROR() function in the procedure to provide tracing information back to the message window to help you debug.
您尝试过使用 TRY 和 CATCH 吗? 它可能会在存储过程中的函数调用上引发您看不到的错误。
Have you tried using TRY and CATCH? It might be throwing an error on a function call within your stored procedure that you won't see.
添加“::睡眠(30000);” 在对 ODBC 语句对象调用执行之后(以及语句关闭命令之前)立即阻止服务器进程过早退出。 一定是 freeodbc++ 的错误或者我的配置错误。
感谢您提供故障排除/调试提示。
Adding "::Sleep(30000);" immediately after I call execute on the ODBC statement object (and before the statement close command) keeps the server process from exiting prematurely. Must be a bug with freeodbc++ or a configuration error on my part.
Thanks for the troubleshooting/debugging tips.