Re: Driver.connect Timeout

From: Jeff Kolesky <jeff(at)edusoft(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: Driver.connect Timeout
Date: 2004-01-31 01:11:57
Message-ID: p06002011bc40b011c429@[192.168.1.79]
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Yes, the case we were experiencing was the driver hanging during the
native socketRead0 method call after having created the Socket
object. We have not been able to reproduce the issue in production,
but I have simulated it and tested this code against an open socket
that reads data but does not respond.

This is certainly not a full implementation of setLoginTimeout()-type
functionality.

Jeff

At 7:53 PM -0500 1/30/04, Kris Jurka wrote:
>On Fri, 30 Jan 2004, Jeff Kolesky wrote:
>
>> As it turns out, I have been working on a solution that will allow
>> you to do just what you want. My company has been running into a
>> problem when a database goes down, that the Driver hangs when trying
>> to create a connection. In response, I added in a way to set the
>> socket timeout during connection creation.
>
>Could you be more specific about the problem that this solves? I was
>under the impression that the call that really needed to be changed was
>connection = new Socket(host,post) in the PGStream constructor because a
>dns or other network error could make this take a long time before timing
>out. Without testing it, your patch looks like it only is useful in the
>case where a connection has been established, but hasn't gone through the
>authentication process and the database crashed in that split second.
>
>Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Green 2004-01-31 03:21:40 Config on Netbeans for OS X Panther
Previous Message Kris Jurka 2004-01-31 00:53:40 Re: Driver.connect Timeout