TransactionScope and Connection Pooling
Posted
by Graham
on Stack Overflow
See other posts from Stack Overflow
or by Graham
Published on 2010-03-11T14:11:31Z
Indexed on
2010/03/15
8:29 UTC
Read the original article
Hit count: 615
Hi,
I'm trying to get a handle on whether we have a problem in our application with database connections using incorrect IsolationLevels. Our application is a .Net 3.5 database app using SQL Server 2005.
I've discovered that the IsolationLevel of connections are not reset when they are returned to the connection pool (see here) and was also really surprised to read in this blog post that each new TransactionScope created gets its own connection pool assigned to it.
Our database updates (via our business objects) take place within a TransactionScope (a new one is created for each business object graph update). But our fetches do not use an explicit transaction. So what I'm wondering is could we ever get into the situation where our fetch operations (which should be using the default IsolationLevel - Read Committed) would reuse a connection from the pool which has been used for an update, and inherit the update IsolationLevel (RepeatableRead)? Or would our updates be guaranteed to use a different connection pool seeing as they are wrapped in a TransactionScope?
Thanks in advance,
Graham
© Stack Overflow or respective owner