You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Clyde Coolidge <cl...@gmail.com> on 2007/11/19 23:58:52 UTC

Does IBatis.Net support command timeouts?

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

RE: Does IBatis.Net support command timeouts?

Posted by "Nicholas L. Piasecki" <ni...@piasecki.name>.
A random aside:

You might also look up "parameter sniffing" since you're using SQL Server,
as well as the "WITH RECOMPILE" option. I lost a few hours of my life to
discovering this "feature," where queries run through iBATIS mysteriously
seem to take orders of magnitude longer than when run through Query Analyzer
(since full table scans were getting triggered due to a poorly optimized
execution plan), depending on what variables I "approached" the stored
procedure or query with the first time I ran it. I'm no SQL guru, but it was
essentially an optimization technique built into SQL Server that usually
works, but borks in a really bad way when the planets don't align correctly.

http://groups.google.com/group/microsoft.public.sqlserver.programming/msg/ff
9e6e72122e1fb (watch that long URL) is a good blurb about it.

Otherwise, you should be able to set it in the connection string-that's the
approach I used when poor parameter sniffing was causing certain queries to
randomly explode. The configuration of your SQL Server can override that
limit, however.

If you're using iBATIS DAO, you could probably futz with the ADO.NET objects
by implementing your own session handler, but you shouldn't have to do that.

Good luck!

V/R,
Nicholas Piasecki

-----Original Message-----
From: Clyde Coolidge [mailto:clydecoolidge@gmail.com] 
Sent: Monday, November 19, 2007 5:59 PM
To: user-cs@ibatis.apache.org
Subject: Does IBatis.Net support command timeouts?

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+Sp
ecific+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


Re: Does IBatis.Net support command timeouts?

Posted by Michael Schall <mi...@gmail.com>.
We extend the timeout with the connection string.  Why is this not working
with you?

On Nov 19, 2007 4:58 PM, Clyde Coolidge <cl...@gmail.com> 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
>