Error while trying to recover from inactive connection

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Error while trying to recover from inactive connection

rJassal
This post was updated on .
Hi All,

I am working with non-XA database.

I define two datasource in properties file also I am using property 'testQuery' to check stale connection. But it shows errors for second datasource.

As Bitronix allows a single non-XA database to participate in a XA transaction, I used the property 'automaticEnlistingEnabled' and set it to 'false'.

Below is the error I am getting.
[bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error running recovery on resource 'jdbc/seconddb', resource marked as failed (background recoverer will retry recovery)
bitronix.tm.recovery.RecoveryException: cannot start recovery on a PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30 connection(s) (30 still available)
        at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
        at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
        at java.lang.Thread.run(Thread.java:662)
Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get valid connection from an XAPool of resource jdbc/seconddb with 30 connection(s) (30 still available) after trying for 30s
        at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
        at bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
        ... 4 more
Caused by: com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:

datasource properties.

resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds2.uniqueName=jdbc/firstdb
resource.ds2.allowLocalTransactions=true
resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
resource.ds2.testQuery=SELECT current_timestamp

resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds3.uniqueName=jdbc/seconddb
resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
resource.ds3.allowLocalTransactions=true
resource.ds3.automaticEnlistingEnabled=false
resource.ds3.testQuery=SELECT current_timestamp
Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

Ludovic Orban-2
The automaticEnlistingEnabled property has nothing to do with the single LRC resource limitation. Unless you have a ver strong reason to manually enlist XAResources yourself you should leave that to true.

BTW, you can disable the multiple-LRC enlistment check by enabling the allowMultipleLrc property on the transaction manager's configuration. Please just keep in mind that you're basically giving up the 2PC recovery guarantee when you use multiple LRC resources in a single transaction.

Nevertheless, you may have found a bug which prevents resources configured for manual enlistment to be recovered. I'll do some testing in that area to make sure nothing's obviously broken.


2011/5/30 rJassal <[hidden email]>

Hi All,

I am working with non-XA database.

I define two datasource in properties file also I am using property
'testQuery' to check stale connection. But it shows errors for second
datasource.

As Bitronix allows a single non-XA database to participate in a XA
transaction, I used the property 'automaticEnlistingEnabled' and set it to
'false'.

Below is the error I am getting.
[bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error running
recovery on resource 'jdbc/seconddb', resource marked as failed (background
recoverer will retry recovery)
bitronix.tm.recovery.RecoveryException: cannot start recovery on a
PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30
connection(s) (30 still available)
       at
bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
       at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
       at bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
       at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
       at java.lang.Thread.run(Thread.java:662)
Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get valid
connection from an XAPool of resource jdbc/jndinextgendb with 30
connection(s) (30 still available) after trying for 30s
       at bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
       at
bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
       ... 4 more
Caused by: com.mysql.jdbc.CommunicationsException: Communications link
failure due to underlying exception:

datasource properties.

resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds2.uniqueName=jdbc/firstdb
resource.ds2.allowLocalTransactions=true
resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
resource.ds2.testQuery=SELECT current_timestamp

resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
resource.ds3.uniqueName=jdbc/seconddb
resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
resource.ds3.allowLocalTransactions=true
resource.ds3.automaticEnlistingEnabled=false
resource.ds3.testQuery=SELECT current_timestamp

--
View this message in context: http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

rJassal
Thanks for the reply.

I will wait for your testing results.

Ludovic Orban-2 wrote
The automaticEnlistingEnabled property has nothing to do with the single LRC
resource limitation. Unless you have a ver strong reason to manually enlist
XAResources yourself you should leave that to true.

BTW, you can disable the multiple-LRC enlistment check by enabling the
allowMultipleLrc property on the transaction manager's configuration. Please
just keep in mind that you're basically giving up the 2PC recovery guarantee
when you use multiple LRC resources in a single transaction.

Nevertheless, you may have found a bug which prevents resources configured
for manual enlistment to be recovered. I'll do some testing in that area to
make sure nothing's obviously broken.


2011/5/30 rJassal <jassal.ravinderjit@gmail.com>

>
> Hi All,
>
> I am working with non-XA database.
>
> I define two datasource in properties file also I am using property
> 'testQuery' to check stale connection. But it shows errors for second
> datasource.
>
> As Bitronix allows a single non-XA database to participate in a XA
> transaction, I used the property 'automaticEnlistingEnabled' and set it to
> 'false'.
>
> Below is the error I am getting.
> [bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error running
> recovery on resource 'jdbc/seconddb', resource marked as failed (background
> recoverer will retry recovery)
> bitronix.tm.recovery.RecoveryException: cannot start recovery on a
> PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30
> connection(s) (30 still available)
>        at
>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
>        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
>        at
> bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
>        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
>        at java.lang.Thread.run(Thread.java:662)
> Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get valid
> connection from an XAPool of resource jdbc/jndinextgendb with 30
> connection(s) (30 still available) after trying for 30s
>        at
> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
>        at
>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
>        ... 4 more
> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
> failure due to underlying exception:
>
> datasource properties.
>
> resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> resource.ds2.uniqueName=jdbc/firstdb
> resource.ds2.allowLocalTransactions=true
> resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
> resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
> resource.ds2.testQuery=SELECT current_timestamp
>
> resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> resource.ds3.uniqueName=jdbc/seconddb
> resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
> resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
> resource.ds3.allowLocalTransactions=true
> resource.ds3.automaticEnlistingEnabled=false
> resource.ds3.testQuery=SELECT current_timestamp
>
> --
> View this message in context:
> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

Ludovic Orban-2
Do you have a special need for manual enlistment? If not, I advise you to set automaticEnlistingEnabled back to true and try setting allowMultipleLrc to true and see if that helps.

Otherwise, you will have to wait as I don't know when I'll find time to work on this.


2011/5/31 rJassal <[hidden email]>

Thanks for the reply.

I will wait for your testing results.


Ludovic Orban-2 wrote:
>
> The automaticEnlistingEnabled property has nothing to do with the single
> LRC
> resource limitation. Unless you have a ver strong reason to manually
> enlist
> XAResources yourself you should leave that to true.
>
> BTW, you can disable the multiple-LRC enlistment check by enabling the
> allowMultipleLrc property on the transaction manager's configuration.
> Please
> just keep in mind that you're basically giving up the 2PC recovery
> guarantee
> when you use multiple LRC resources in a single transaction.
>
> Nevertheless, you may have found a bug which prevents resources configured
> for manual enlistment to be recovered. I'll do some testing in that area
> to
> make sure nothing's obviously broken.
>
>
> 2011/5/30 rJassal <[hidden email]>
>
>>
>> Hi All,
>>
>> I am working with non-XA database.
>>
>> I define two datasource in properties file also I am using property
>> 'testQuery' to check stale connection. But it shows errors for second
>> datasource.
>>
>> As Bitronix allows a single non-XA database to participate in a XA
>> transaction, I used the property 'automaticEnlistingEnabled' and set it
>> to
>> 'false'.
>>
>> Below is the error I am getting.
>> [bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error
>> running
>> recovery on resource 'jdbc/seconddb', resource marked as failed
>> (background
>> recoverer will retry recovery)
>> bitronix.tm.recovery.RecoveryException: cannot start recovery on a
>> PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30
>> connection(s) (30 still available)
>>        at
>>
>> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
>>        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
>>        at
>> bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
>>        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
>>        at java.lang.Thread.run(Thread.java:662)
>> Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get
>> valid
>> connection from an XAPool of resource jdbc/jndinextgendb with 30
>> connection(s) (30 still available) after trying for 30s
>>        at
>> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
>>        at
>>
>> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
>>        ... 4 more
>> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
>> failure due to underlying exception:
>>
>> datasource properties.
>>
>> resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
>> resource.ds2.uniqueName=jdbc/firstdb
>> resource.ds2.allowLocalTransactions=true
>> resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
>> resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
>> resource.ds2.testQuery=SELECT current_timestamp
>>
>> resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
>> resource.ds3.uniqueName=jdbc/seconddb
>> resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
>> resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
>> resource.ds3.allowLocalTransactions=true
>> resource.ds3.automaticEnlistingEnabled=false
>> resource.ds3.testQuery=SELECT current_timestamp
>>
>> --
>> View this message in context:
>> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
>> Sent from the Bitronix Transaction Manager mailing list archive at
>> Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>>
>
>

--
View this message in context: http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31737601.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

rJassal
I think this 'allowMultipleLrc' is only applicable to BTM 2.1.1, right?
How about 'ignoreRecoveryFailures'? (this also required btm 2.1.1).
Will it help for the errors I am getting?

Ludovic Orban-2 wrote
Do you have a special need for manual enlistment? If not, I advise you to
set automaticEnlistingEnabled back to true and try setting allowMultipleLrc
to true and see if that helps.

Otherwise, you will have to wait as I don't know when I'll find time to work
on this.


2011/5/31 rJassal <jassal.ravinderjit@gmail.com>

>
> Thanks for the reply.
>
> I will wait for your testing results.
>
>
> Ludovic Orban-2 wrote:
> >
> > The automaticEnlistingEnabled property has nothing to do with the single
> > LRC
> > resource limitation. Unless you have a ver strong reason to manually
> > enlist
> > XAResources yourself you should leave that to true.
> >
> > BTW, you can disable the multiple-LRC enlistment check by enabling the
> > allowMultipleLrc property on the transaction manager's configuration.
> > Please
> > just keep in mind that you're basically giving up the 2PC recovery
> > guarantee
> > when you use multiple LRC resources in a single transaction.
> >
> > Nevertheless, you may have found a bug which prevents resources
> configured
> > for manual enlistment to be recovered. I'll do some testing in that area
> > to
> > make sure nothing's obviously broken.
> >
> >
> > 2011/5/30 rJassal <jassal.ravinderjit@gmail.com>
> >
> >>
> >> Hi All,
> >>
> >> I am working with non-XA database.
> >>
> >> I define two datasource in properties file also I am using property
> >> 'testQuery' to check stale connection. But it shows errors for second
> >> datasource.
> >>
> >> As Bitronix allows a single non-XA database to participate in a XA
> >> transaction, I used the property 'automaticEnlistingEnabled' and set it
> >> to
> >> 'false'.
> >>
> >> Below is the error I am getting.
> >> [bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error
> >> running
> >> recovery on resource 'jdbc/seconddb', resource marked as failed
> >> (background
> >> recoverer will retry recovery)
> >> bitronix.tm.recovery.RecoveryException: cannot start recovery on a
> >> PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30
> >> connection(s) (30 still available)
> >>        at
> >>
> >>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
> >>        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
> >>        at
> >> bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
> >>        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
> >>        at java.lang.Thread.run(Thread.java:662)
> >> Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get
> >> valid
> >> connection from an XAPool of resource jdbc/jndinextgendb with 30
> >> connection(s) (30 still available) after trying for 30s
> >>        at
> >> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
> >>        at
> >>
> >>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
> >>        ... 4 more
> >> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
> >> failure due to underlying exception:
> >>
> >> datasource properties.
> >>
> >> resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> >> resource.ds2.uniqueName=jdbc/firstdb
> >> resource.ds2.allowLocalTransactions=true
> >> resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
> >> resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
> >> resource.ds2.testQuery=SELECT current_timestamp
> >>
> >> resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> >> resource.ds3.uniqueName=jdbc/seconddb
> >> resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
> >> resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
> >> resource.ds3.allowLocalTransactions=true
> >> resource.ds3.automaticEnlistingEnabled=false
> >> resource.ds3.testQuery=SELECT current_timestamp
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
> >> Sent from the Bitronix Transaction Manager mailing list archive at
> >> Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31737601.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

rJassal
One more doubt I have, is if safe/recommended to use 'allowMultipleLrc' in production environment?

rJassal wrote
I think this 'allowMultipleLrc' is only applicable to BTM 2.1.1, right?
How about 'ignoreRecoveryFailures'? (this also required btm 2.1.1).
Will it help for the errors I am getting?

Ludovic Orban-2 wrote
Do you have a special need for manual enlistment? If not, I advise you to
set automaticEnlistingEnabled back to true and try setting allowMultipleLrc
to true and see if that helps.

Otherwise, you will have to wait as I don't know when I'll find time to work
on this.


2011/5/31 rJassal <jassal.ravinderjit@gmail.com>

>
> Thanks for the reply.
>
> I will wait for your testing results.
>
>
> Ludovic Orban-2 wrote:
> >
> > The automaticEnlistingEnabled property has nothing to do with the single
> > LRC
> > resource limitation. Unless you have a ver strong reason to manually
> > enlist
> > XAResources yourself you should leave that to true.
> >
> > BTW, you can disable the multiple-LRC enlistment check by enabling the
> > allowMultipleLrc property on the transaction manager's configuration.
> > Please
> > just keep in mind that you're basically giving up the 2PC recovery
> > guarantee
> > when you use multiple LRC resources in a single transaction.
> >
> > Nevertheless, you may have found a bug which prevents resources
> configured
> > for manual enlistment to be recovered. I'll do some testing in that area
> > to
> > make sure nothing's obviously broken.
> >
> >
> > 2011/5/30 rJassal <jassal.ravinderjit@gmail.com>
> >
> >>
> >> Hi All,
> >>
> >> I am working with non-XA database.
> >>
> >> I define two datasource in properties file also I am using property
> >> 'testQuery' to check stale connection. But it shows errors for second
> >> datasource.
> >>
> >> As Bitronix allows a single non-XA database to participate in a XA
> >> transaction, I used the property 'automaticEnlistingEnabled' and set it
> >> to
> >> 'false'.
> >>
> >> Below is the error I am getting.
> >> [bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error
> >> running
> >> recovery on resource 'jdbc/seconddb', resource marked as failed
> >> (background
> >> recoverer will retry recovery)
> >> bitronix.tm.recovery.RecoveryException: cannot start recovery on a
> >> PoolingDataSource containing an XAPool of resource jdbc/seconddb with 30
> >> connection(s) (30 still available)
> >>        at
> >>
> >>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
> >>        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
> >>        at
> >> bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
> >>        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
> >>        at java.lang.Thread.run(Thread.java:662)
> >> Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get
> >> valid
> >> connection from an XAPool of resource jdbc/jndinextgendb with 30
> >> connection(s) (30 still available) after trying for 30s
> >>        at
> >> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
> >>        at
> >>
> >>
> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
> >>        ... 4 more
> >> Caused by: com.mysql.jdbc.CommunicationsException: Communications link
> >> failure due to underlying exception:
> >>
> >> datasource properties.
> >>
> >> resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> >> resource.ds2.uniqueName=jdbc/firstdb
> >> resource.ds2.allowLocalTransactions=true
> >> resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
> >> resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
> >> resource.ds2.testQuery=SELECT current_timestamp
> >>
> >> resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
> >> resource.ds3.uniqueName=jdbc/seconddb
> >> resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
> >> resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
> >> resource.ds3.allowLocalTransactions=true
> >> resource.ds3.automaticEnlistingEnabled=false
> >> resource.ds3.testQuery=SELECT current_timestamp
> >>
> >> --
> >> View this message in context:
> >>
> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
> >> Sent from the Bitronix Transaction Manager mailing list archive at
> >> Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe from this list, please visit:
> >>
> >>    http://xircles.codehaus.org/manage_email
> >>
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31737601.html
> Sent from the Bitronix Transaction Manager mailing list archive at
> Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Error while trying to recover from inactive connection

Ludovic Orban-2
Yes, allowMultipleLrc was introduced in BTM 2.1.1 but it's definitely not safe for production usage. And it's the concept itself that is not safe, not the BTM implementation: it's impossible to guarantee atomicity over multiple resources when more than one of them does not support the XA protocol.


ignoreRecoveryFailures may help but also shouldn't be used on production. What happened when you re-enabled automatic enlistment? Didn't that solve your recovery problem?


2011/5/31 rJassal <[hidden email]>

One more doubt I have, is if safe/recommended to use 'allowMultipleLrc' in
production environment?


rJassal wrote:
>
> I think this 'allowMultipleLrc' is only applicable to BTM 2.1.1, right?
> How about 'ignoreRecoveryFailures'? (this also required btm 2.1.1).
> Will it help for the errors I am getting?
>
>
> Ludovic Orban-2 wrote:
>>
>> Do you have a special need for manual enlistment? If not, I advise you to
>> set automaticEnlistingEnabled back to true and try setting
>> allowMultipleLrc
>> to true and see if that helps.
>>
>> Otherwise, you will have to wait as I don't know when I'll find time to
>> work
>> on this.
>>
>>
>> 2011/5/31 rJassal <[hidden email]>
>>
>>>
>>> Thanks for the reply.
>>>
>>> I will wait for your testing results.
>>>
>>>
>>> Ludovic Orban-2 wrote:
>>> >
>>> > The automaticEnlistingEnabled property has nothing to do with the
>>> single
>>> > LRC
>>> > resource limitation. Unless you have a ver strong reason to manually
>>> > enlist
>>> > XAResources yourself you should leave that to true.
>>> >
>>> > BTW, you can disable the multiple-LRC enlistment check by enabling the
>>> > allowMultipleLrc property on the transaction manager's configuration.
>>> > Please
>>> > just keep in mind that you're basically giving up the 2PC recovery
>>> > guarantee
>>> > when you use multiple LRC resources in a single transaction.
>>> >
>>> > Nevertheless, you may have found a bug which prevents resources
>>> configured
>>> > for manual enlistment to be recovered. I'll do some testing in that
>>> area
>>> > to
>>> > make sure nothing's obviously broken.
>>> >
>>> >
>>> > 2011/5/30 rJassal <[hidden email]>
>>> >
>>> >>
>>> >> Hi All,
>>> >>
>>> >> I am working with non-XA database.
>>> >>
>>> >> I define two datasource in properties file also I am using property
>>> >> 'testQuery' to check stale connection. But it shows errors for second
>>> >> datasource.
>>> >>
>>> >> As Bitronix allows a single non-XA database to participate in a XA
>>> >> transaction, I used the property 'automaticEnlistingEnabled' and set
>>> it
>>> >> to
>>> >> 'false'.
>>> >>
>>> >> Below is the error I am getting.
>>> >> [bitronix.tm.recovery.Recoverer] (bitronix-recovery-thread:) error
>>> >> running
>>> >> recovery on resource 'jdbc/seconddb', resource marked as failed
>>> >> (background
>>> >> recoverer will retry recovery)
>>> >> bitronix.tm.recovery.RecoveryException: cannot start recovery on a
>>> >> PoolingDataSource containing an XAPool of resource jdbc/seconddb with
>>> 30
>>> >> connection(s) (30 still available)
>>> >>        at
>>> >>
>>> >>
>>> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:227)
>>> >>        at bitronix.tm.recovery.Recoverer.recover(Recoverer.java:253)
>>> >>        at
>>> >>
>>> bitronix.tm.recovery.Recoverer.recoverAllResources(Recoverer.java:223)
>>> >>        at bitronix.tm.recovery.Recoverer.run(Recoverer.java:138)
>>> >>        at java.lang.Thread.run(Thread.java:662)
>>> >> Caused by: bitronix.tm.internal.BitronixRuntimeException: cannot get
>>> >> valid
>>> >> connection from an XAPool of resource jdbc/jndinextgendb with 30
>>> >> connection(s) (30 still available) after trying for 30s
>>> >>        at
>>> >>
>>> bitronix.tm.resource.common.XAPool.getConnectionHandle(XAPool.java:156)
>>> >>        at
>>> >>
>>> >>
>>> bitronix.tm.resource.jdbc.PoolingDataSource.startRecovery(PoolingDataSource.java:223)
>>> >>        ... 4 more
>>> >> Caused by: com.mysql.jdbc.CommunicationsException: Communications
>>> link
>>> >> failure due to underlying exception:
>>> >>
>>> >> datasource properties.
>>> >>
>>> >> resource.ds2.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
>>> >> resource.ds2.uniqueName=jdbc/firstdb
>>> >> resource.ds2.allowLocalTransactions=true
>>> >> resource.ds2.driverProperties.driverClassName=com.mysql.jdbc.Driver
>>> >> resource.ds2.driverProperties.url=jdbc:mysql://localhost:3306/firstdb
>>> >> resource.ds2.testQuery=SELECT current_timestamp
>>> >>
>>> >> resource.ds3.className=bitronix.tm.resource.jdbc.lrc.LrcXADataSource
>>> >> resource.ds3.uniqueName=jdbc/seconddb
>>> >> resource.ds3.driverProperties.driverClassName=com.mysql.jdbc.Driver
>>> >>
>>> resource.ds3.driverProperties.url=jdbc:mysql://localhost:3306/seconddb
>>> >> resource.ds3.allowLocalTransactions=true
>>> >> resource.ds3.automaticEnlistingEnabled=false
>>> >> resource.ds3.testQuery=SELECT current_timestamp
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31730814.html
>>> >> Sent from the Bitronix Transaction Manager mailing list archive at
>>> >> Nabble.com.
>>> >>
>>> >>
>>> >> ---------------------------------------------------------------------
>>> >> To unsubscribe from this list, please visit:
>>> >>
>>> >>    http://xircles.codehaus.org/manage_email
>>> >>
>>> >>
>>> >>
>>> >
>>> >
>>>
>>> --
>>> View this message in context:
>>> http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31737601.html
>>> Sent from the Bitronix Transaction Manager mailing list archive at
>>> Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe from this list, please visit:
>>>
>>>    http://xircles.codehaus.org/manage_email
>>>
>>>
>>>
>>
>>
>
>

--
View this message in context: http://old.nabble.com/Error-while-trying-to-recover-from-inactive-connection-tp31730814p31742328.html
Sent from the Bitronix Transaction Manager mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email