[PATCH] Support for ping method. - Mailing list pgsql-jdbc

From Michael Barker
Subject [PATCH] Support for ping method.
Date
Msg-id 1144305529.2955.11.camel@corona
Whole thread Raw
Responses Re: [PATCH] Support for ping method.  (Kris Jurka <books@ejurka.com>)
List pgsql-jdbc
Hi,

Attached is a patch that adds support for a ping method on the
AbstractJdbc2Connection.  This is useful for JBoss (and other
containers) where the container needs to check if the connection is
alive before passing it to the caller.  Currently JBoss does a "SELECT
1", but using the new ping method there is a boost in performance.
Opening and closing 1000 connections from a datasource:

PGTest1 (SELECT 1) 1000 iterations: 2491ms

PGTest2 (ping())   1000 iterations: 63ms

All is does is send a sendSync and wait for a valid response.

Regards,
Michael Barker.

Attachment

pgsql-jdbc by date:

Previous
From: "markds75"
Date:
Subject: Re: PostgreSQL (XADataSource) as Tomcat Resource
Next
From: Pavan Kumar
Date:
Subject: Re: thread hang on execute call