issues with concurrent SqlConnections and SqlTransactions...
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngescalate' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Kirk Marple (VIP)
i asked this twice before on aspngdata, and didn't get any response. it
seems like a pretty serious bug... i basically can't use SqlTransactions at
all. thanks for somebody taking the time to look at this.

--------------

i'm having some serious issues with SqlTransactions in Beta 2.

steps (pseudo-code):
- create/open new SqlConnection for DAL class A
- create new SqlCommand for DAL class A
- set command text to "sproc1" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A

- create/open new SqlConnection for DAL class B
- begin transaction on connection for DAL class B
- create new SqlCommand for DAL class B
- assign transaction to SqlCommand for DAL class B
- set command text to "sproc2" for SqlCommand, DAL class B
- call ExecuteNonQuery on SqlCommand for DAL class B

- set command text to "sproc3" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A
*** SqlException generated, timeout on command

the SqlConnection for DAL class A never even had a transaction created on
it, but it hangs when ExecuteNonQuery is called.

crazy thing is these steps fail also...

- create/open new SqlConnection for DAL class A
- begin transaction on connection for DAL class A
- create new SqlCommand for DAL class A
- assign transaction to SqlCommand for DAL class A
- set command text to "sproc1" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A

- create/open new SqlConnection for DAL class B
- create new SqlCommand for DAL class B
- set command text to "sproc2" for SqlCommand, DAL class B
- call ExecuteNonQuery on SqlCommand for DAL class B
*** SqlException generated, timeout on command

it's like there's interplay going on between SqlConnections, even when they
should be distinct.

i wanted to also mention that if i take out the BeginTransaction call,
everything works perfectly. that seems to be the key change that causes
problems. btw, this is running against a SQL2K db, and all machines are
updated to MDAC 2.7, Win2K SP2, etc.

i've already filed this as a bug with MSFT too.

Kirk

------ End of Forwarded Message
Reply to this message...
 
    
Mitch Denny (VIP)
Kirk,

What connection string are you using?

----------------------------------------
- Mitch Denny
- http://www.warbyte.com
- Click here to reveal e-mail address
- +61 (414) 610-141
-

-----Original Message-----
From: Kirk Marple [mailto:Click here to reveal e-mail address]
Sent: Thursday, 16 August 2001 2:47 PM
To: aspngescalate
Subject: [aspngescalate] issues with concurrent SqlConnections and
SqlTransactions...

i asked this twice before on aspngdata, and didn't get any response. it
seems like a pretty serious bug... i basically can't use SqlTransactions
at all. thanks for somebody taking the time to look at this.

--------------

i'm having some serious issues with SqlTransactions in Beta 2.

steps (pseudo-code):
- create/open new SqlConnection for DAL class A
- create new SqlCommand for DAL class A
- set command text to "sproc1" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A

- create/open new SqlConnection for DAL class B
- begin transaction on connection for DAL class B
- create new SqlCommand for DAL class B
- assign transaction to SqlCommand for DAL class B
- set command text to "sproc2" for SqlCommand, DAL class B
- call ExecuteNonQuery on SqlCommand for DAL class B

- set command text to "sproc3" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A
*** SqlException generated, timeout on command

the SqlConnection for DAL class A never even had a transaction created
on it, but it hangs when ExecuteNonQuery is called.

crazy thing is these steps fail also...

- create/open new SqlConnection for DAL class A
- begin transaction on connection for DAL class A
- create new SqlCommand for DAL class A
- assign transaction to SqlCommand for DAL class A
- set command text to "sproc1" for SqlCommand, DAL class A
- call ExecuteNonQuery on SqlCommand for DAL class A

- create/open new SqlConnection for DAL class B
- create new SqlCommand for DAL class B
- set command text to "sproc2" for SqlCommand, DAL class B
- call ExecuteNonQuery on SqlCommand for DAL class B
*** SqlException generated, timeout on command

it's like there's interplay going on between SqlConnections, even when
they should be distinct.

i wanted to also mention that if i take out the BeginTransaction call,
everything works perfectly. that seems to be the key change that causes
problems. btw, this is running against a SQL2K db, and all machines are
updated to MDAC 2.7, Win2K SP2, etc.

i've already filed this as a bug with MSFT too.

Kirk

------ End of Forwarded Message
| [aspngescalate] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp = JOIN/QUIT

Reply to this message...
 
    
Mitch Denny (VIP)
Kirk,

Sorry for not getting back to you after you posted the connection string
that you are using. Did you get any where with Microsoft? The reason I
am interested is because Dan Green identified a problem with connections
hanging up if transactions were aborted. I am not sure where the problem
was exactly, but it seemed to be caused by the interplay between
transactions, connection pooling and possibly even threading.

I'd suggest that you pursue the matter with vigour with your
Microsoft contacts to ensure that it is fixed come RTM.

In the meantime, can you show the code you are using?

----------------------------------------
- Mitch Denny
- http://www.warbyte.com
- Click here to reveal e-mail address
- +61 (414) 610-141
-

[Original message clipped]

Reply to this message...
 
 
System.Data.SqlClient.SqlCommand
System.Data.SqlClient.SqlConnection
System.Data.SqlClient.SqlException




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com