Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set TimeOut Expired in NHibernate

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

like image 690
user3124690 Avatar asked Apr 15 '14 10:04

user3124690


1 Answers

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.

like image 194
Najera Avatar answered Oct 09 '22 08:10

Najera