views:

18

answers:

1

Hello, Is there a way to set the command timeout for everything generated by subsonic?

-Edward

A: 

For MySql you can sepecify the CommandTimeout in the connectionstring:

<connectionStrings>
    <add name="Local" connectionString="Server=localhost;
       Database=db;uid=admin;Password=pass;default command timeout=60" />
</connectionStrings>

But for SqlServer you can't do that afaik. For SubSonic 2 there is no easy way to achive that. There are multiple command timeouts hard coded in the source (look at the file SqlDataProvider.cs)

Query.cs

private int commandTimeout = 60;

QueryCommand.cs

/// <summary>
/// Summary for the QueryCommand class
/// </summary>
public class QueryCommand
{
    private string _providerName = String.Empty;
    private int commandTimeout = 60;  // change to whatever you like and recompile

StoredProedure.cs:

private int commandTimeout = 60;

I don't know if I missed some parts but if you change these values and recompile SubSonic you should be fine.

If you don't want to do that and you use the Query Tool you can set the timeout at runtime with

cmd.CommandTimeout = 600;
SchlaWiener