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

  • Home
  • SEARCH
  • 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 970231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:46:20+00:00 2026-05-16T02:46:20+00:00

I’ve asked: How to break connections TCP/IP by keepalive postgreSQL without changing anything in

  • 0

I’ve asked: How to break connections TCP/IP by keepalive postgreSQL without changing anything in the register?

And now, I want to confirm:

My system (C#.NET, NHibernate and Active Record) is running with a database PostgreSQL 8.4 and a Windows Server. I need a way to break idle or lost TCP/IP connections and unblock data.

I can’t tweak OS configs nor recompile the PostgreSQL. My system can run in Oracle 10g Express if needed! I need to know: Can I break idle conections without implement a new patch for PostgreSQL? Do I need to migrate my database to Oracle for that?

Thanks,

  • 1 1 Answer
  • 1 View
  • 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-05-16T02:46:21+00:00Added an answer on May 16, 2026 at 2:46 am

    If there’s a way to force each new connection to execute a query at connect time, you could write a database function that dynamically calls “pg_terminate_backend(pid)” for any processes that are in some criteria. Without knowing your setup, some possibilities are:

    • Connections with current_query = ‘ in transaction’ and CURRENT_TIMESTAMP – query_start() greater than some value (1 minute? 5 minutes?)
    • Connections from your IP address or individual user name (if exists) that you aren’t currently using (probably not a good idea in connection-pooling environments, though)

    Personally, I would try and refactor in order to minimize the amount of time any transaction can possibly be open. Some places where you may have a transaction open unnecessarily, resulting in an increased chance of triggering your problem:

    • An ORM is running with AutoCommit turned off.
    • A LOCK is taken when data is read for an edit screen so the data cannot be updated before it is written back. It may be acceptable to verify before writing back that there’s no conflict.
    • Transactions started before a non-database task, like an FTP or Email process, then closed afterwards.
    • Transactions where the very first statement is a SELECT without a locking clause (like “FOR UPDATE”). The result of this SELECT will be the same whether it is inside or outside the transaction, so it’s an indicator that the transaction was started too early and could be shortened.
    • Transactions that only contain one statement of any kind.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.