2

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

I am using CastleProject ActiveRecord over NHibernate, C# 3.5. I have multiple subsequent inserts to a database within TransactionScope. One of them (random, different each time) fails with TimeoutException. Whichever timeout I set in my config file (10 hours), this does not matter. If I do not use transaction scope, it work (but too slow). It seems, NHibernate transaction has default timeout 30 second and is not affected by hibernate.command_timeout value.

Is it correct? How to overcome this?

Community
  • 1
  • 1
Alex
  • 1,357
  • 3
  • 18
  • 41

1 Answers1

1

Have you tried increasing your connection time out value?

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

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

John Korsnes
  • 2,277
  • 2
  • 20
  • 31