I have a problem using SqlTransaction. Here's the code
SqlConnection conn = new SqlConnection(connectionString);
// assume that at this point I add try/catch and the connection is successfully opened.
conn.Open();
SqlTransaction trans = conn.BeginTransaction(IsolationLevel.RepeatableRead);
//.........
// Here I do my action with database, change it, commit, call ExecuteNonQuery, //ExecuteScalar,etc...
// And after that long processing with this transaction, I don't know why trans.Connection //is null. and therefore when I call trans.commit(), an exception was raised?
trans.commit();
Does anybody have any clues?
I assume this might be because of memory of database server was ate up because of too much connections. But I'm not sure.
How can I resolve this?