Re: Connection question - Mailing list pgsql-general

From Craig Ringer
Subject Re: Connection question
Date
Msg-id 4C7F1517.1060703@postnewspapers.com.au
Whole thread Raw
In response to Connection question  ("Bayless Kirtley" <bkirt@cox.net>)
List pgsql-general
On 09/01/2010 11:22 PM, Bayless Kirtley wrote:

> About twice per month, it is necessary to reset the modem and router. This,
> of course, loses the manager's connection to the DB.

With modern OSes, and many much older ones, it's not "of course" at all.
Windows XP Pro is quite odd in that it breaks TCP/IP connections when an
interface goes down and comes back up with the same IP address.

Windows 7 even retains my SSH connections, made over wifi, when
suspended and resumed! They only break if PuTTY tries to send a packet
while the interface is still down after resume.

Really, resetting a switch, unplugging a network cable and plugging it
back in, etc shouldn't break TCP/IP connections, unless it triggers the
connected host to do a new DHCP request, and the DHCP server hands out a
different  IP. No decent DHCP server will do that, but some cheap and
nasty modem/router units don't store DHCP leases across a reboot so they
"forget" their MAC address to IP address mappings.

Anyway, that's a bit of a tangent, since you're on XP Pro and stuck with
its rather less than ideal handling of connection loss.

> The problem is, it
> also
> seems to break the connection at the cash register. The next time it
> tries to
> record a transaction, it gets the error "Unable to write to the backend" or
> something very close to that.

Is the register application connecting to localhost (127.0.0.1) or to
the public IP address assigned by DHCP to the register's ethernet
interface? If the latter, you're being bitten by Windows XP tossing out
all TCP/IP connections involving that IP.

If you're not sure, the easiest way I can think of to find out is to
unplug the register from the network, restart the router and see if it
can still connect. It should be able to.

--
Craig Ringer

pgsql-general by date:

Previous
From: John R Pierce
Date:
Subject: Re: postgreSQL problem
Next
From: Gerhard Wiesinger
Date:
Subject: Double iteration in the buffer cache code