Timeout Exception When Timeout Set To Infinite Time
Solution 1:
It's correct that a value of 0 indicates no timeout (as defined in the MSDN docs), however while NHibernate's driver passes the config value to the db command when it's >= 0, the batcher's condition checks that the value is > 0.
Therefore, when you set batching on, with a timeout value of 0, the value isn't carried over to the db command so it remains as default.
It's entirely possible that this is by design, and that NHibernate developers intentionally disabled disabling timeouts for batch scenarios. Disabling timeout is a bad idea anyway, if you have troubles with timeout errors I would raise the value, but not disable it.
Please confirm this with NHibernate devs.
Solution 2:
You might be looking to set the timeout for specific queries and not at web.config level (otherwise you really need to tune up your application :) ).
I've recently found this answer that helped me:
How to set Nhibernate LINQ Command Timeout using Session.Query
Post a Comment for "Timeout Exception When Timeout Set To Infinite Time"