N
Natan Vivo
I'm getting a timeout error while trying to select data from SQL server
2005 after opening a transaction in asn asp.net application.
It goes like this:
SqlConnection conn1 = new SqlConnection(...);
conn1.Open();
SqlTransaction trans = conn1.Open();
// do some inserts and updates using the transaction
SqlConnection conn2 = new SqlConnection(...);
conn2.Open();
// select using conn2 and decide what to do
conn2.Close();
// do more inserts and updates based on that decision
trans.Commit();
conn1.Commit();
It probably has something to do with the connection pool returning the
already open conn1 to connection2.
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
receive the transaction.
Is there any other option? Is there any way to really open another
connection, or the connection pool to not return open connections being
used in transactions?
Thanks.
2005 after opening a transaction in asn asp.net application.
It goes like this:
SqlConnection conn1 = new SqlConnection(...);
conn1.Open();
SqlTransaction trans = conn1.Open();
// do some inserts and updates using the transaction
SqlConnection conn2 = new SqlConnection(...);
conn2.Open();
// select using conn2 and decide what to do
conn2.Close();
// do more inserts and updates based on that decision
trans.Commit();
conn1.Commit();
It probably has something to do with the connection pool returning the
already open conn1 to connection2.
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
receive the transaction.
Is there any other option? Is there any way to really open another
connection, or the connection pool to not return open connections being
used in transactions?
Thanks.