开发者

sql clr timeout

开发者 https://www.devze.com 2023-02-07 01:33 出处:网络
I have a CLR Stored procedure thatcalls a webmethod. The webmethod call is a somewhat long running taks ( about 3 minutes to complete). The CLRsp does not call Sql server at all, However it times out.

I have a CLR Stored procedure that calls a webmethod. The webmethod call is a somewhat long running taks ( about 3 minutes to complete). The CLR sp does not call Sql server at all, However it times out. How can I adjust the time out. The code is as follows:

  [SqlProcedure]
    public static int RunSessionForTrid(string sessionName, string trid, out SqlString msg)
    {
        string sxml = GetSessionForTrid(sessionName, trid);
        using (BaaNServices b = new BaaNServices())
        {
            try
            {
                开发者_Python百科msg = b.BaanSession(sxml);
                SqlContext.Pipe.Send((string)msg);
                return 0;
            }
            catch (Exception ex)
            {
                msg = ex.Message;
                SqlContext.Pipe.Send(ex.Message);
                //throw ex;
                return -1;
            }
        }
    }
    #endregion  


You could also run the method asynchronosly. The CLR sp would end immediately and you could not return a result, but you would not have any timeout problems.

Disposing the Webreference should be done in the async callback.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号