logo       

Re: libpq - check PGconn* - is it valid: msg#00031

Subject: Re: libpq - check PGconn* - is it valid
On Wednesday 11 October 2006 11:33 am, Dmitriy Chumack <saint@xxxxxxxxxxxx> 
thus communicated:
>  Hi everyone.
>
>  I have such a problem. My application, some server, use libpq librarry
>  to interact with PostgreSQL-8.1.0 database. Postgresql server and my
>  server work on different computers in the local network. When my server
>  starts, it creates pool of 10 connections to database. My server use
>  PQexec() to submit queries to db. But when there is no network
>  connection to the database (I simply unplug the network cable from
>  computer on which PG server is run) and my server calls PQexec() -
>  than it hangs in PQexec() call. And it will hang there for a very
>  long time (I wait about 30 minutes and there is no result). And
>  when I plug in the network cable back, PQexec() remains hanging (I
>  wait about 10 minutes and there is no result too).
>
>  I use simply (not ssl) connection to db.
>
>  So how can I check PGconn pointer if it represent a health connection
>  to prevent my server to hang in PQexec() call?
>
>  Thanks in advance.

Use: ConnStatusType PQstatus(const PGconn *conn);
See the docs for details.
-- 
Terry Lee Tucker
Turbo's IT Manager
Turbo, division of Ozburn-Hessey Logistics
2251 Jesse Jewell Pkwy NE
Gainesville, GA 30501
Tel: (336) 372-6812  Fax: (336) 372-6812  Cell: (336) 363-4719
terry@xxxxxxxxxxxxx
www.turbocorp.com



---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
boot-loaders.gr...    php.pear.genera...    debugging.valgr...    kde.redhat.user...    text.xml.xsl.ge...    culture.languag...    hardware.microc...    java.servicemix...    redhat.release....    web.zope.plone....    user-groups.lin...    opendarwin.webk...    video.mjpeg.use...    sysutils.bcfg2....    encryption.gpg....    lx-office.devel...    xfree86.forum/2...    mail.mutt.devel...    acpi.devel/2003...    qnx.openqnx.dev...    network.irc.irs...    freebsd.devel.m...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe