Skip site navigation (1) Skip section navigation (2)

how to modify connection socket timeout

From: "Peirong Feng (pefeng)" <pefeng(at)cisco(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: how to modify connection socket timeout
Date: 2009-06-04 20:28:59
Message-ID: C7610190419B9C4FB4D86381A5A1CCE001E56E86@xmb-sjc-23c.amer.cisco.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hi there,

It seems that the socket inside the connections returned by jdbc driver
has a fixed timeout value (30 seconds). Is there anyway we can set the
timeout for these sockets?

            Jdbc3PoolingDataSource dataSource = new
Jdbc3PoolingDataSource();
            dataSource.setDataSourceName("Test Source");
            dataSource.setServerName(REMOTE_HOST_);
            dataSource.setDatabaseName(DB_NAME);
            dataSource.setUser(DB_USER_);
            dataSource.setPassword(DB_PWD_);
            dataSource.setInitialConnections(INITIAL_CONNECTION_);
            dataSource.setMaxConnections(MAX_CONNECTION_);
            try{
                dataSource.setLoginTimeout(REMOTE_CONNECTION_TIMEOUT_);
            }catch(SQLException sqle){
                logger.warning(sqle.getMessage());
            }

The issue here is that once the pool is initialized and then we unplug
the cable, the connections inside pool don't realize that the connection
is gone and still timeout in 30 seconds.

Thanks.
Peirong


pgsql-jdbc by date

Next:From: Simon RiggsDate: 2009-06-04 21:53:33
Subject: Re: Deadlock detection
Previous:From: Oliver JowettDate: 2009-06-04 13:22:56
Subject: Re: Strings with null characters produce exceptions when selectedor inserted. Attempts to select messages with null bytes produces "ERROR:insufficient data left in message". And inserting produces "ERROR: invalidbyte sequence for encoding \"UTF8\":

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group