> I'm getting a timeout error while trying to select data from SQL server
> 2005 after opening a transaction in asn asp.net application.
[quoted text clipped - 31 lines]
>
> Thanks.
Have you changed the default CommandTimeout from the default? I think
the default for ASP/ASP.NET is 30 seconds.

Signature
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Natan Vivo - 12 Jul 2006 16:33 GMT
> Have you changed the default CommandTimeout from the default? I think
> the default for ASP/ASP.NET is 30 seconds.
No, and it is not the problem. The whole process takes less than 1 second.
The thing is exactly what I told. If I open an second connection and
select something, while connection one is in transaction, it hangs and
gives me a connection timeout.
Can anyone reproduce this?
Tracy McKibben - 12 Jul 2006 16:46 GMT
>> Have you changed the default CommandTimeout from the default? I think
>> the default for ASP/ASP.NET is 30 seconds.
[quoted text clipped - 6 lines]
>
> Can anyone reproduce this?
Not knowing what selects you're running in connection 2, I'd have to say
you're probably deadlocking against the open transaction in connection 1.
http://realsqlguy.com/twiki/bin/view/RealSQLGuy/SimulatingADeadlock

Signature
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Natan Vivo - 13 Jul 2006 14:01 GMT
>>> Have you changed the default CommandTimeout from the default? I
>>> think the default for ASP/ASP.NET is 30 seconds.
[quoted text clipped - 12 lines]
>
> http://realsqlguy.com/twiki/bin/view/RealSQLGuy/SimulatingADeadlock
Thanks. It was really a deadlock, the select was selecting data from the
same table I had already update.
It seems I can solve this by using the right IsolationLevel when
begining the transaction.
I'll test it later. Thanks!
Tracy McKibben - 13 Jul 2006 14:12 GMT
> Thanks. It was really a deadlock, the select was selecting data from the
> same table I had already update.
[quoted text clipped - 3 lines]
>
> I'll test it later. Thanks!
Be careful that you're not reading "dirty" data, meaning data that is
inconsistent because it's been partially altered by a transaction...

Signature
Tracy McKibben
MCDBA
http://www.realsqlguy.com
Neil B - 12 Jul 2006 17:30 GMT
>> Have you changed the default CommandTimeout from the default? I think
>> the default for ASP/ASP.NET is 30 seconds.
[quoted text clipped - 6 lines]
>
> Can anyone reproduce this?
Yes, I had the exact same problem in an application of mine. In the
absence of finding a solution, I coded around it. Sorry I can't be of
more help, but you're not alone. :)
Neil B
> I'm getting a timeout error while trying to select data from SQL server
> 2005 after opening a transaction in asn asp.net application.
[quoted text clipped - 21 lines]
> It probably has something to do with the connection pool returning the
> already open conn1 to connection2.
No, that's not how the connection pool works. If you have two open
connections in your code, you'll be using two connections from the
connection pool.
> In the actual process, the select using the 2nd connection is being
> opened in another method, and I don't want to overload the method to
[quoted text clipped - 5 lines]
>
>From your description, it's almost certainly a deadlock on sql server.
Without seeing the database code, it's going to be difficult to help
you out.
To confirm it's a deadlock, open a connection using query analyser,
start your code running, then run sp_who2. It'll show your second
connection being blocked by your first.
Damien