Severe concurrency issues with .Net 2.0 and SQL Server 2005

G

Guest

I am not sure if this is the right group to post to but I fugured I'd start
here. Let me know if there is a more appropriate group. I wanted to try the
forums before I wait 3+ hours on the phone to get a suport incident opened.

I am having sever concurrenct issues with a web app running on Server
2003, IIS 6, .Net 2.0 and using SQL Server 2005. The code works fine with a
single user but when I run a jMeter test against it with 3 or more threads
(emulating 3 or more users) I get errors all over the place. Different errors
at different places to make things even more fun. The errors occur when
multiple people are on as well so I don't think it is jMeter.

In general the errors occur when trying to open a SqlConnection or run an
ExceuteReader on a SqlCommand. The errors are usually either
"ExecuteReader requires an open and available Connection. The connection's
current state is connecting" or "invalid attempt to Read when reader is
closed".

This is not a multi threaded app.

The is no indication on the SQL Server side. What requests get through are
being handled fine.

There are no errors in the event viewer or web logs.

Does anyone have any ideas as to what might be happening, where I might
look or what I might try ?
 
C

Cowboy \(Gregory A. Beamer\)

Static connection object? That is a common reason for this issue.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 
J

Jesse Houwing

* Cowboy (Gregory A. Beamer) wrote, On 25-7-2007 19:42:
Static connection object? That is a common reason for this issue.

That would've been my guess as well. Or a Connection object that's
stored in the Application or Session scope. Both equally bad.

Jesse
 
G

Guest

I am in fact using a static connection object. I will recode it and see if
that takes care of it.

Thank you for your prompt reply to this.
 
C

Cowboy \(Gregory A. Beamer\)

Yeah, I had to show a vendor recently that static connection objects are a
bad thing. They were causing a huge number of errors on our site. A static
connection string is fine, but static objects are bad ... in this case.

Session and Application would both be static, so I concur on their
"badness". :)

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 
C

Cowboy \(Gregory A. Beamer\)

I had to deal with that recently. A vendor was using static connection
objects for all of his business objects. It creates a real nasty set of side
effects.

You can, technically, get around the closed connection by checking
connection status before loading reader, but the static object will still be
a bottleneck in the application that kills scalability.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************
 

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