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 8641155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:27:13+00:00 2026-06-12T11:27:13+00:00

I double checked my code and I have conn.close in the finally block but

  • 0

I double checked my code and I have conn.close in the finally block but when I do SELECT * FROM pg_stat_activity; I see many idle connections. How can I fix this?

  • 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-12T11:27:14+00:00Added an answer on June 12, 2026 at 11:27 am

    The most likely cause of this is that your application is using a connection pool. If so, the pool will grab connections and keep a portion of them open so that they can be reused. The connections will show as IDLE until another command is executed or the application is shut down.

    If the connection was simply not being closed you would probably see something like IDLE – In Transaction which means that the connection is open and waiting for a commit or rollback to be executed, but not receiving any commands.

    Also, I know you say you close the connections so i am not sure if this applies to you, but I just wanted to throw out that I have also experienced problems in the past by not explicitly closing PreparedStatements.

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

Sidebar

Related Questions

I have read through different articles such as Double-checked locking: Clever, but broken and
Here is my code:- I have double checked all the auth parameters. import tweepy
I dont know what is happening, I have double checked my code in PHP
I've double checked all the connections in the nib file. My code - //
I have a 2884765579 bytes file. This is double checked with this function, that
In my project directory, top level, I have Icon.png. Double-checked in Photoshop, it's 57x57.
I keep on running across code that uses double-checked locking, and I'm still confused
I already double checked my URL, and the name of the files, but I
I'm reading an article from this website , but when i run the code
The problems with the original Double-Checked Locking pattern have been well-documented: C++ and the

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.