Thanks for the answer..
After implementing the close and open in my singleton I still got some errors with my connection, now it was because of connection was still open. But I was closing the connection in a finalize, so I was sure it was closed everytime. After adding some sync locking to my code, everythings works like a charm.. Didn't know that asp.net runs its code-behind in multiple threads.. hmm..
User Profile
Collapse
-
SQLConnection open and close vs. staying open.
My question is performance wize, is it better to open and close each time I make a request to the database, in small periods I make like 5 queryes a second, other times only every 10 seconds.
I can understand that close and open do not close the underlaying connection, so would the correct way be to open and close with each request, and give a better chance of avoiding faulty connection? Or would it cause worse performance?
...
No activity results to display
Show More
Leave a comment: