Thanks for the response Michael.  The connection string only allows
you to set the Connection Timeout, which is just the number of seconds
to wait for the application to initially connect to the data source.
This is different from a Command Timeout, which tells the server how
many seconds to wait for the completion of any command send to the
data source.  In the case of my long-running query, I need to increase
the Command Timeout, which cannot be done via the connection string
and does not inherit from the Connection Timeout value.

Through some more research, it seems that I can subclass the
CreateCommand method on IDbProvider, set the CommandTimeout to
whatever I wish, and then set the DataSource property of my ISqlMapper
object to this new object.  If anybody has gone down this path before,
or if anyone thinks this is the wrong approach, I would truly
appreciate any feedback or advice.

- Clyde

---------- Forwarded message ----------
From: "Michael Schall" <[EMAIL PROTECTED]>
To: [email protected]
Date: Mon, 19 Nov 2007 20:35:19 -0600
Subject: Re: Does IBatis.Net support command timeouts?

We extend the timeout with the connection string.  Why is this not
working with you?

On Nov 19, 2007 4:58 PM, Clyde Coolidge <[EMAIL PROTECTED] > wrote:
> I've searched all over for this information and could only find this
> link, which appears specific to the Java implementation.
>
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/Environment+Specific+Information
>
> My problem is that long(ish)-running queries are timing out because
> IBatis seems to be using a default SqlCommand object (in this case I'm
> using the sqlServer2.0 provider).  Is there either a way I can control
> this on a SQL statement level or at least increase the default timeout
> across the entire data source.  I know that a Connection Timeout can
> be specified within the connection string itself, but this does not
> solve the issue.
>
> I could download the latest source and go hunting through the code to
> try and modify this, but was hoping someone could point me in the
> right direction before I start stabbing in the dark :-)
>
> Best Regards,
> Clyde
>

Reply via email to