.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification