Comments are available to members only. Sign up or Log in to view these comments.
Main Topics
Browse All TopicsHi,
I a using VB.net 2005 and i have a class in my app which i use to create a sql connection.
So in the rest of my class's/forms ect i create a new reference to my db class call a function and it returns an open SQLConnection.
I have made sure that all the calling functions at the end in my try Catch Finally statement i do th efollowing
DBConnection.Dispose() 'SqlConnection variable declared Locally to the calling function
DBConnection = Nothing
DB_Connect = Nothing 'This is the Class instance name
Now from what i have read, a sqlconnection is an "UnManaged" resource and thats why i need to use the dispose method first.
The problem comes in when i open the SQL Activity Monitor, it shows a whole list of connections to my database and they are in the sleep state.
Then after say 5 minutes they disappear from the list.
So i am unsure of a few things here
1. Am i closing my sql connection objects/refereces from my code correctly
2. Does SQL Server run its own type of "GAC" and removes dormant or sleeping connections after a specific time?
3. By using the dipose and set to nothing commands, should that not immediately close those connections in the Activity Monitor
4. Or is this normal what i am experincing and should not worry?
As i have created a multi threaded service so i need to make sure i clean up correcly
thanks
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: rionrocPosted on 2009-01-07 at 06:57:01ID: 23315185
Comments are available to members only. Sign up or Log in to view these comments.