I recently increased the size of my test database and now I am encoutering a SQL timeout error. The default command timeout is 30 seconds and I thought I had increased it, but it seems like I am missing something. Here is what I have done:
1. In my aBusiness (subclass of mmBusinessObject), I have added:
protected override OakLeaf.MM.Main.Data.mmDataAccessBase CreateDataAccessObject(string dataAccessClassName)
{
return base.CreateDataAccessObject(dataAccessClassName);
}
2. In Factory.cs, I added:
public override OakLeaf.MM.Main.Data.mmDataAccessSql CreateDataAccessSql()
{
return new aDataAccessSql();
}
3. I created the class aDataAccessSql (subclass of mmDataAccessSql) and added:
public override IDbCommand CreateCommand(string cmdText)
{
// call the base class method
IDbCommand cmd = base.CreateCommand(cmdText);
// set the command timeout
cmd.CommandTimeout = 600; // 10 minutes
return cmd;
}
The business object (subclass of aBusiness) is calling the GetDataSet() method. If I set a break point in the base business object FillDataSet() method, the CommandTimeout is still set to 30.
If I set a break point in the CreateCommand() method of aDataAccessSql, it never fires. Any ideas or suggestions are greatly appreciated.
Kind Regards,
Mat