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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:09:53+00:00 2026-05-30T20:09:53+00:00

I am using postgres 9.0 database , where In my C program I connect

  • 0

I am using postgres 9.0 database , where In my C program I connect the database only once
and using fork I generate processes , where all my child program shares the connection
Most of the time it works correctly ,
In some cases child A gets the query error of child B , and It also gets the query time out issues and all

My question is , Is there any wrong to share the connections ?
per second it may create 1 to 5 processes at the max

Note:
I never closes the connection at all

  • 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-05-30T20:09:55+00:00Added an answer on May 30, 2026 at 8:09 pm

    It’s not a good idea for threads to share a single database connection because you’ll run into the exact issue that you described in your question: one thread can get the output of another thread’s request. Instead, you’ll want each thread to connect separately. If you have a lot of threads, you might want to consider making a connection pool.

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

Sidebar

Related Questions

With doctrine syntax using postgres as database, is it possible to generate a query
I am using libpqxx to connect to a postgres database by creating a class.
Is there any way to connect to Postgres database using MySQL Workbench? I was
I'm using a hand built (Postgres) database with Django. With inspectdb I was able
Is it possible to have the postgres database dump(pg_dump) using SQLAlchemy? i can get
We are currently deploying some applications on a glassfish 3.0.1 using a postgres database
I'm trying to do an insert or update in a postgres database using node.js
im using Postgres 9.0 to save images into the database using 'lo_import' and to
I am using a hibernate application to store data in Postgres database I have
We have a Postgres database which contains 2 millions entries. We have tried using

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.