Setting Linq to NHibernate ADO Command Timeout
Asked Answered
A

2

4

How do I increase the timeout in NHibernate Linq To Sql?

Not the Connection Timeout but the ado command timeout.

using (ISession session = NHibernateHelper.OpenSession(NHibernateHelper.Databases.CarrierCDR))
  using (session.BeginTransaction(IsolationLevel.ReadUncommitted))
  {
   lCdrs = (from verizon in session.Linq<Domain.Verizon>()
             where verizon.Research == true
             && verizon.ReferenceTable == null
             orderby verizon.CallBillingDate descending 
              select verizon).ToList();
}
Ardor answered 25/3, 2010 at 22:3 Comment(1)
Will someone please edit the title of this question to something more descriptive.Hernadez
V
1

if you are configuring your NHibernate session with the web.config you can add this to the config:

<add key="hibernate.command_timeout" value="0" />
Voletta answered 5/10, 2010 at 11:37 Comment(1)
The problem is that this property isn't used for the actual command when Linq query is executed. It always timeouts after ~30 sec.Prosimian
H
0

The only mention of a command timeout parameter in all of fluent nhibernate's source code is in a FirebirdConfiguration object. Which configures the application for the firebird database, which you are probably not using. I would suggest playing with your configuration objects, and consulting your database's connection string reference.

The Raw function in the PersistenceConfiguration may allow you to access the properties you are looking for, like FirebirdConfiguration, you could add the line Raw("command_timeout", "444");, to where your configure nhibernate.

Hernadez answered 10/4, 2010 at 5:37 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.