From: | Peter Geoghegan <peter(dot)geoghegan86(at)gmail(dot)com> |
---|---|
To: | Jasen Betts <jasen(at)xnet(dot)co(dot)nz> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Re: Connecting to a postgreSQL database with windows CE over wi-fi; failing gracefully |
Date: | 2009-05-01 12:56:00 |
Message-ID: | db471ace0905010556k369b1966y435c6f0d1c33e27f@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
I apologise for the duplicate posts - my initial post wasn't appearing
on the mailing list archives hours later, and someone in #postgresql
said that there was a problem with the service provider, so I thought
I'd resend.
> such an approach is doomed to failure, you have just implemented a
> race condition. what happens if the server becomes unavailable between
> the request and the response, or during the response.
It had occurred to me that this was the case. However, even though the
suggested approach is sub-optimal, it still significantly ameliorates
the problem - the server may be shut down intentionally by someone
that is not aware that the handset is being used much of the time, and
that is unlikely to occur the instant between checking the connection
is all right and using the connection. If you can suggest an
alternative approach that doesn't have a race condition, I'm all ears.
Also, maybe you should give the hyperbole a rest.
> when you shut the server down it announces this to the clients, it may
> even ask their permission before proceeding.
Yes, that too had occurred to me. I recall that Slony-I really hates
it when you cut the connection, but is fine when you shut down
PostgreSQL correctly. From the Slony-I docs : "Any problems with that
connection can kill the connection whilst leaving "zombied" database
connections on the node that (typically) will not die off for around
two hours." It doesn't necessarily follow that my program should die
though, but it does. My guess is that libpq is calling abort() or
something similar, directly or indirectly. I know that would cause an
error message with windows XP, but windows CE is funny.
> you are not checking the return values from some of your libpq calls.
The only thing that I don't check the return value of is PQreset,
which returns void. What do you mean?
Regards,
Peter Geoghegan
From | Date | Subject | |
---|---|---|---|
Next Message | Grzegorz Jaśkiewicz | 2009-05-01 12:57:03 | xml not enabled by default on rhel4 packages from commandprompt |
Previous Message | Craig Ringer | 2009-05-01 12:42:53 | Re: recover corrupt DB? |