Timeout exception when using NHibernate TransactionScope

This is a continuation of the Timeout Exception when the timeout is set to infinite time (and I also see the unanswered SqlConnection and TransactionScope Timeout ).

I am using CastleProject ActiveRecord over NHibernate, C # 3.5. I have a few subsequent inserts into the database in TransactionScope. One of them (random, different each time) fails with a TimeoutException. Whatever timeout I set in my configuration file (10 hours), it does not matter. If I do not use the transaction scope, it works (but too slowly). The NHibernate transaction seems to have a default timeout of 30 seconds and is independent of the value of hibernate.command_timeout.

Is it correct? How to overcome this?

+1
source share
1 answer

Have you tried to increase the connection timeout?

Include in the connection string "Connection timeout = somehighvalueinsecondshere".

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlconnection.connectiontimeout.aspx

+1
source

Source: https://habr.com/ru/post/1767635/


All Articles