users@glassfish.java.net

Re: auto reconnect to database via JNDI after DB restart

From: apache avro <apache.component_at_gmail.com>
Date: Wed, 3 Jul 2013 16:16:55 -0400

This issue is now fixed. Apart from the connection pool validation
attributes, I had to write some code to check for the SQLSTATE
"admin-shutdown" based on which I had to re create the connection object.

Thanks for all your help Marina and Users.

Thank You
-M


On Wed, Jul 3, 2013 at 8:31 AM, apache avro <apache.component_at_gmail.com>wrote:

> Fails this way too.
>
> Thank You
> -M
>
>
> On Fri, Jun 28, 2013 at 5:34 PM, Marina Vatkina <marina.vatkina_at_oracle.com
> > wrote:
>
>> That's weird. May be the resource points to a different pool? Can you
>> try naming it jdbc-test-pool (i.e. without '/')?
>>
>> thanks,
>> -marina
>>
>> On 6/27/13 8:22 AM, apache avro wrote:
>>
>> Problem persists even with derby database.
>>
>> "*java.sql.SQLNonTransientConnectionException*: A communications error
>> has been detected: Software caused connection abort: recv failed."
>>
>> Any ideas?
>>
>> Thank You
>>
>>
>>
>> On Wed, Jun 26, 2013 at 9:16 PM, apache avro <apache.component_at_gmail.com>wrote:
>>
>>> I'll try to do it as soon as I get in tomorrow. Thanks Marina.
>>>
>>>
>>> On Wed, Jun 26, 2013 at 4:52 PM, Marina Vatkina <
>>> marina.vatkina_at_oracle.com> wrote:
>>>
>>>> Actually my last idea wasn't right - you have a non-xa resource, so tx
>>>> recovery won't help (unless the same DB is indeed used as a tx resource by
>>>> another app).
>>>>
>>>> Can you try with Derby to exclude Postgres problems?
>>>>
>>>> thanks,
>>>> -marina
>>>>
>>>>
>>>> On 6/26/13 12:07 PM, apache avro wrote:
>>>>
>>>> No. No transactions in progress.
>>>> Is there any way to debug this?
>>>>
>>>>
>>>> On Wed, Jun 26, 2013 at 2:53 PM, Marina Vatkina <
>>>> marina.vatkina_at_oracle.com> wrote:
>>>>
>>>>> Are there any transaction in progress when the DB goes down? You
>>>>> might need to run 'recover-transactions' CLI. Otherwise it might be a DB
>>>>> issue.
>>>>>
>>>>> -marina
>>>>>
>>>>>
>>>>> On 6/26/13 5:31 AM, apache avro wrote:
>>>>>
>>>>> 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
>>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>>
>