Randomly get timeout on SqlClient hitting localhost

G

Guest

Hi;

I get this error randomly on both my home and work computer. I'm hitting Sql
Server 2000 dev version on localhost. This happens on both my home and work
computer.

Here's the exception:
System.Data.SqlClient.SqlException occurred
Message="Timeout expired. The timeout period elapsed prior to completion
of the operation or the server is not responding."
Source=".Net SqlClient Data Provider"
ErrorCode=-2146232060
Class=11
LineNumber=0
Number=-2
Procedure=""
Server="localhost"
State=0
StackTrace:
at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet
bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString)
at
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method,
DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method)
at
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at
net.windward.datasource.ado.AdoDataSource.executeQuery(IDbConnection conn,
String select) in
C:\src\kahuna\DotNetEngine\WindwardReports\net\windward\datasource\ado\AdoDataSource.jsl:line 1852

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Hi Dave,

From your description, you're getting some timeout exception in your
application randomly, correct?

It seems your ADO.NET code will meet connection unusable condition
randomly. Have you checked the server-side to see whether there is anything
abnormal sometimes? Since the code works mostly and if the code logic is
not quite complex, I think client-side should be ok.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
G

Guest

That's what is so strange about this - it is all on one machine. And this is
not a web app, it a Forms app. So there isn't much to go wrong at the
communications layer.

The other thing I just realized - it times-out fast. In under a second. So
there is some reason that it decides it is a timeout other than taking a long
time trying to connect.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
S

Steven Cheng[MSFT]

Thanks for your reply Dave,

Since it is a client form application, I think the problem should not be
caused by performance stress. If possible, you can try connecting to
different database to see whether you'll encounter the same error.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

William \(Bill\) Vaughn

Okay, the timeouts can occur on any system. There are (generally) two types
of timeouts that occur : Connection timeouts and Command timeouts. The
former can be caused by a connection pool issue or by the server (or system)
being too busy to process the query. The latter can be caused by a lock
conflict or (again) the server being too busy to complete the operation in
time. Just because it's a client system does not mean that there aren't
other competing applications fighting for CPU time--like Age Of Empires. ;)

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
G

Guest

I think (going on memory here) that it only happens when I am running under
the debugger. Could that cause some kind of lockout?

It happens fast. It's not that a couple of seconds goes by and then it
returns this error - it's in under a second. So I don't think it's a true
timeout.

Age of Empires - love that game. Haven't played in awhile though. Enemy
Nations rocks too.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
W

William \(Bill\) Vaughn

Ah, the SQL Server debugger STOPS the service when you hit the breakpoint...
;) Could that be an issue for other developers?

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
W

William \(Bill\) Vaughn

Or is that the CLR debugger... ;(
CLR Debugger. Yes, but in debug mode you are interfering with the service
process... it could be the issue.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------
 
S

Steven Cheng[MSFT]

Hi Dave,

Have you got any progress on this? If there is anything else we can help,
please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
S

Steven Cheng[MSFT]

Thanks for your reply Dave,

So far I haven't found any definite record on ADO.NET 2.0's connection
timeout behavior under debugging mode, I've found one kb article mentioned
the behavior for VS 2003/.NET 1.1.

#You may receive the "Connection timeout" error message when you use SQL
debugging in Visual Studio .NET 2003
http://support.microsoft.com/?id=905853

And some former threads/cases does mentioend similar behavior, but haven't
conclude to a common definte cause.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

William \(Bill\) Vaughn

I have seen situations where the ConnectionTimeout value is exceeded when
pausing during some debug operations--but only on the system where the
debugging is occurring.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
 
G

Giri Gopal

Hi I am using this below code to convert rtf templete to Pdf Report
using XML data source. Its working fine. But I dont know how to do the
same using SQL datasource. Pls help me out in this

Thanks,
Giri.


import net.windward.xmlreport.*;
import net.windward.datasource.dom4j.*;
import java.io.*;
public class SimpleReport {
public static void main(String[] args) throws Exception {
System.out.println("Template file: " + args[0]);
System.out.println("Report file: " + args[1]);
//System.out.println("Data file: " + args[2]);
// create the report object, giving it the template and output streams
ProcessPdfAPI report = new ProcessPdf(new FileInputStream(args[0]),
new FileOutputStream(args[1]));
// initialize the report object
report.processSetup();
// apply a datasource to the template. This can be called multiple
// times, passing in numerous datasources.
report.processData(new Dom4jDataSource(new FileInputStream(args[2])),
null);
// create the output report.
report.processComplete();
System.out.println("Report creation successful!");
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top