How to maintain isolation level in MSSQL SERVER 2000?
-
Hi Friends, My problem is that , my application is using common transaction object , when multiple users trying to access the application resources simultaneously it will show me the error datareader is already opened . Can anybody suggest me , how to maintain these problem? My application is using ASP.NET as front-end. Could it be maintained by maintaining isolation/concurrency in database? Please , reply your suggestions. Thanking you in advance, Param
param
-
Hi Friends, My problem is that , my application is using common transaction object , when multiple users trying to access the application resources simultaneously it will show me the error datareader is already opened . Can anybody suggest me , how to maintain these problem? My application is using ASP.NET as front-end. Could it be maintained by maintaining isolation/concurrency in database? Please , reply your suggestions. Thanking you in advance, Param
param
Best practice is to use a separate connection for every logical database query (if you have a lot of queries in the same function, it's fine to use the same connection for all of them, but you shouldn't use the same connection object in different functions). Ensure that you
Dispose
the connections when you've finished with them. ADO.NET has connection pooling support which is enabled by default. This will avoid the overhead of connecting unless there are no free connections in the pool. Your error is occurring because another thread, processing another request, already has aDataReader
open on the connection, and that's not allowed.Stability. What an interesting concept. -- Chris Maunder
-
Best practice is to use a separate connection for every logical database query (if you have a lot of queries in the same function, it's fine to use the same connection for all of them, but you shouldn't use the same connection object in different functions). Ensure that you
Dispose
the connections when you've finished with them. ADO.NET has connection pooling support which is enabled by default. This will avoid the overhead of connecting unless there are no free connections in the pool. Your error is occurring because another thread, processing another request, already has aDataReader
open on the connection, and that's not allowed.Stability. What an interesting concept. -- Chris Maunder
Hi Thanks for your reply. But, I have closed the connection n used seperate connection foe every logical database query..but in my code i have used common transaction object for every query..will it create any problem? becoz every time wen multi user are accessing the system random error are comings.sometime it gives internal fatal error.some time it gives ur reader is opened with this connection.I am very sure tht i have close the connection n the data reader both. I wud be very pleased if u can give some solution to this problem Thanking you in advance Param
param