Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8705951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T03:29:33+00:00 2026-06-13T03:29:33+00:00

I am getting the following exception in the website which has to a large

  • 0

I am getting the following exception in the website which has to a large extent deal with data entry operations. It also has Indexes defined on the tables in the associated database. The database calls are made via SQLHelper. For e.g. SQLHelper.ExecuteNonQuery() etc. I cannot see anywhere that the Close() or Dispose() method of the SQLConnection is invoked. So I am assuming that SQLHelper must be taking care of it as I have also read about it on various sites. Also, to check the code in combination with Close() or Dispose() is also very tedious as SQLHelper is used in many places and there are many classes where business logic is defined. The exception that I am getting is:

The record was not updated Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.

For now I have tested the code with putting GC.Collect in the Application_EndRequest Method of Global.asax and everything as of now is working fine. But I know that it is strictly not recommend to use the same.

Any help will be GREATLY appreciated as I am stuck @ present..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T03:29:34+00:00Added an answer on June 13, 2026 at 3:29 am

    Not sure which version of your SQLHelper is, but if you can’t see any connection.Close() been called then you need manually call it to make sure connection closed. Garbage collector will not close the connection for you.

    EDIT

    Also about the connection pooling it’s by default enabled by .Net itself, you call connection.Close() does not mean the connection between your application to SQL Server really been closed, it’s just return that connection back to connection pool and wait for others to grab. Only if after a while nobody open new connection that connection them will be physically closed, so you should not need to worry about call connection.Close() too many times, instead of that you need to call it asap to release the resource for other threads to use.

    For more detail please check how Microsoft saying about connection pool: http://msdn.microsoft.com/en-us/library/8xx3tyca.aspx

    ANOTHER EDIT
    I suggest you find an updated version of SQLHelper or go ahead change SQLHelper to add Close() in it. Even if you found GC help you closed the connection but you should not use it that way, GC is not designed for release database connection but just memory, also GC.Collect() is not guaranteed it will immediately do it right away to start garbage collection.

    Also you are coding web application so you need to think concurrency, what if when you calling GC.Collect() when another thread is running, will that slow down your system to other users?

    It’s a common sense that those limited resources (like db connection, TCP/IP port, file read/write handler etc)need to be released as soon as possible. If you are looking for an easy way to make you coding easily without even using connection.Close then you are going to a wrong direction, I understand you want simply you code and not add that line everywhere but you at least need to make sure SQLHelper doing the job to close connection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the following exception while adding data into database: org.hibernate.HibernateException: The database
Following is the json data which i am getting from an api { list:
I am getting Following Exception while configuring the Connection Pool in Tomcat This is
trying to use hibernate with my web app and getting following exception: Initial SessionFactory
I have created mock: GuiExHandler mockGuiEx = EasyMock.createMock(MockedClass.class); And Im getting following exception: Testcase:
I'm getting the following exception when I run my application in Release mode from
I am getting the following exception when i try to use the fetchall method
I am getting the following exception: Nullable object must have a value Everything was
I'm getting the following exception when executing the first preparedstatement after a period of
I am getting he following Exception while running my Quartz Schdular program. Below is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.