Problem: After a rollback of a transaction the next hit to database throws following error
Code: Select all
{"The transaction associated with the current connection has completed but has not been disposed. The transaction must be disposed before the connection can be used to execute SQL statements."}
- I make a call to a method to update some records in database(Using TransactionScope).
- While updating database the transaction gets rollback.
- So again I call the same method to update the database since it got rollback but I get the above error.
- After this all the calls to the methods throws the same error for certain period of time.
Our Investigation:
1. To make sure the transactions are disposed we are making all our database calls in "Using" statement & also explicitly disposing it off using Dispose method.
2. When we change the ConnectionString parameter "Pooling" to false then it works fine without any errors. But setting the "Pooling" property to true throws the above exception after a rollback.
3. We are also using the "Validate Connection" parameter to validate a connection.
4. One more thing is that if we change the "Min Pool Size" value from 0 to something else say 20 then we get the above error at a later stage after rollback & not immediately.
Would like to know how we can troubleshoot this or its the issue with dotConnect for MySql.
Thanks for help.