users@glassfish.java.net

Re: auto reconnect to database via JNDI after DB restart

From: apache avro <apache.component_at_gmail.com>
Date: Wed, 26 Jun 2013 08:31:36 -0400

Hello Marina,
Thanks for the quick suggestion.
I have already tried using the connection validation attributes but it did
not help.

This is how the connection-pool looks like

*<jdbc-connection-pool name="jdbc/test-pool"
                          res-type="javax.sql.DataSource"
                          datasource-classname
="org.postgresql.ds.PGPoolingDataSource"
                          ping="true" pool-resize-quantity="5" max-pool-size
="10"
                          statement-cache-size="10"
is-connection-validation-required="true"
                          connection-validation-method="table"
                          validation-table-name="myschema.test">
...
...
*
*</jdbc-connection-pool>*

Please suggest.

Thank You


On Tue, Jun 25, 2013 at 4:10 PM, Marina Vatkina
<marina.vatkina_at_oracle.com>wrote:

> Connection validation should help.
>
> -marina
>
>
> On 6/25/13 12:19 PM, apache avro wrote:
>
>> Hello All,
>> I have an application that uses JNDI to interact with postgresql.
>> Whenever, there is a DB server restart, unless I restart glassfish I'm
>> unable to interact with my DB. My efforts to use fail-all-connections,
>> is-connection-validation-**required and other attributes were futile.
>>
>> Please suggest a way to get my application to work with database without
>> having to restart glassfish whenever I restart database server.
>>
>> Thank You
>> Max
>>
>
>