문제

I have a stored procedure in sql server 2008 R2 which was working fine, but suddenly it throws an exception of TimeOut Expiration.

BmDaoSession.CreateSQLQuery("exec SP_Name @Param1  = '" + clientCode + "', @Param2 ='" + existingDatabase + "', @Flag='" + flag + "'").ExecuteUpdate();

I am using the above NHibernate command to call my SP.

My question is how Can I set the TimeOut Expiration in NHibernate. Thanks

도움이 되었습니까?

해결책

Just add fluently SetTimeout method:

BmDaoSession.CreateSQLQuery("exec SP_Name @Param1  = '" + clientCode + "', @Param2 ='" + existingDatabase + "', @Flag='" + flag + "'")
    .SetTimeout(120)
    .ExecuteUpdate();

For more information you can read here.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top