durusmail: durus-users: Connections lost when server restarts
Connections lost when server restarts
2009-10-13
2009-10-15
Connections lost when server restarts
Binger David
2009-10-15
On Oct 13, 2009, at 9:13 AM, Patrick Dobbs wrote:

> Hello,
>
> I'm using ClientStorage in a long running, single threaded
> application. It seems to make sense for the Connection object to be
> long lived so it can do caching goodness. However, if the server is
> restarted then the connection is broken and an exception is raised.
> Since this can occur on read as well as write operations the only
> solution I can see is to wrap the entire application in a try/
> except. This seems clumsy.

The ClientStorage can't really pick up where it left off with a new
server connection.  The
old server, just before terminating, might have been holding
invalidations that have not
yet been delivered to your client.  Once the server terminates, the
record of these pending
invalidations is lost, and the new server has no way of knowing what
the client is
holding that is out of date.  There is a similar problem with oid
allocation.

>
> I'm sure this is an issue which is addressed in QPy and other
> applications, and I was wondering if someone could suggest a good
> solution.
>

In QP, the control program, "qp" always restarts the clients when it
restarts the Durus server.
Unless we are updating the Durus code, we usually just leave the Durus
server running
when we updating the code for an application.

In your long running application, maybe you could use a FileStorage
directly.
That's better if you don't happen to need to support multiple clients.

reply