Problem with Mysql and Mssql

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem with Mysql and Mssql

caroline.n

Hi

 

I’m trying to use BTM as a transaction manager for mysql and mssql

 

I’m getting the following error.

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

 

StackTrace:

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)

      at $Proxy1.prepareStatement(Unknown Source)

      at jtatest.BTMWithMySqlAndMsSql.main(BTMWithMySqlAndMsSql.java:128)

Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist more than one non-XA resource, tried enlisting an XAResourceHolderState with uniqueName=jdbc/ARC_DW_SPA_APP_DEV XAResource=a JDBC LrcXAResource in state NO_TX with XID null, already enlisted: an XAResourceHolderState with uniqueName=jdbc/javatest XAResource=a JDBC LrcXAResource in state STARTED (started) with XID a Bitronix XID [3137322E32302E312E3933000001369BC3076500000000 : 3137322E32302E312E3933000001369BC3082D00000002]

      at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:107)

      at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)

      at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)

      ... 8 more

Apr 10, 2012 3:48:31 PM bitronix.tm.BitronixTransactionManager shutdown

INFO: shutting down Bitronix Transaction Manager

 

Can you please help?

 

Thanks,

Caroline

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem with Mysql and Mssql

Ludovic Orban-2
You've configured your connection pools using the LRC adapter and by default, BTM does not allow multiple LRC resources to participate in a transaction as this gives up the recovery guarantee.

This is definitely not recommended in a production environment, but for development you can configure BTM to allow this by setting the allowMultipleLrc config property to true, see: http://btm.codehaus.org/api/2.1.2/bitronix/tm/Configuration.html#setAllowMultipleLrc%28boolean%29

As a reminder: no single transaction manager can guarantee that transactions involving multiple non-XA resources will result in an atomic outcome. BTM just very explicitly prevents you from doing this by accident while other TMs may silently allow this and fail during error recovery.

--
 Ludovic


On Tue, Apr 10, 2012 at 12:28 PM, Caroline <[hidden email]> wrote:

Hi

 

I’m trying to use BTM as a transaction manager for mysql and mssql

 

I’m getting the following error.

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

 

StackTrace:

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)

      at $Proxy1.prepareStatement(Unknown Source)

      at jtatest.BTMWithMySqlAndMsSql.main(BTMWithMySqlAndMsSql.java:128)

Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist more than one non-XA resource, tried enlisting an XAResourceHolderState with uniqueName=jdbc/ARC_DW_SPA_APP_DEV XAResource=a JDBC LrcXAResource in state NO_TX with XID null, already enlisted: an XAResourceHolderState with uniqueName=jdbc/javatest XAResource=a JDBC LrcXAResource in state STARTED (started) with XID a Bitronix XID [3137322E32302E312E3933000001369BC3076500000000 : 3137322E32302E312E3933000001369BC3082D00000002]

      at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:107)

      at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)

      at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)

      ... 8 more

Apr 10, 2012 3:48:31 PM bitronix.tm.BitronixTransactionManager shutdown

INFO: shutting down Bitronix Transaction Manager

 

Can you please help?

 

Thanks,

Caroline


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Problem with Mysql and Mssql

caroline.n

Hi  Ludovic,

 

I tried setAllowMultipleLrc option, and it worked.

 

Also I tried MSSQL as an XA data source and Mysql as LRC resource. It also worked.

 

Thanks a lot

Caroline


From: [hidden email] [mailto:[hidden email]] On Behalf Of Ludovic Orban
Sent: Tuesday, April 10, 2012 4:45 PM
To: [hidden email]
Subject: Re: [btm-user] Problem with Mysql and Mssql

 

You've configured your connection pools using the LRC adapter and by default, BTM does not allow multiple LRC resources to participate in a transaction as this gives up the recovery guarantee.

This is definitely not recommended in a production environment, but for development you can configure BTM to allow this by setting the allowMultipleLrc config property to true, see: http://btm.codehaus.org/api/2.1.2/bitronix/tm/Configuration.html#setAllowMultipleLrc%28boolean%29

As a reminder: no single transaction manager can guarantee that transactions involving multiple non-XA resources will result in an atomic outcome. BTM just very explicitly prevents you from doing this by accident while other TMs may silently allow this and fail during error recovery.

--
 Ludovic

On Tue, Apr 10, 2012 at 12:28 PM, Caroline <[hidden email]> wrote:

Hi

 

I’m trying to use BTM as a transaction manager for mysql and mssql

 

I’m getting the following error.

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

 

StackTrace:

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in state NO_TX

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:86)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnectionHandle.java:243)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass.java:63)

      at $Proxy1.prepareStatement(Unknown Source)

      at jtatest.BTMWithMySqlAndMsSql.main(BTMWithMySqlAndMsSql.java:128)

Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist more than one non-XA resource, tried enlisting an XAResourceHolderState with uniqueName=jdbc/ARC_DW_SPA_APP_DEV XAResource=a JDBC LrcXAResource in state NO_TX with XID null, already enlisted: an XAResourceHolderState with uniqueName=jdbc/javatest XAResource=a JDBC LrcXAResource in state STARTED (started) with XID a Bitronix XID [3137322E32302E312E3933000001369BC3076500000000 : 3137322E32302E312E3933000001369BC3082D00000002]

      at bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:107)

      at bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)

      at bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransaction(TransactionContextHelper.java:70)

      at bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnectionHandle.java:84)

      ... 8 more

Apr 10, 2012 3:48:31 PM bitronix.tm.BitronixTransactionManager shutdown

INFO: shutting down Bitronix Transaction Manager

 

Can you please help?

 

Thanks,

Caroline

 

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Problem with Mysql and Mssql

Valli85
Hi! I have a similar issue on Jetty 8.

Can you tell me how you configured that!

Thank you
caroline.n wrote
Hi  Ludovic,

 

I tried setAllowMultipleLrc option, and it worked.

 

Also I tried MSSQL as an XA data source and Mysql as LRC resource. It also
worked.

 

Thanks a lot

Caroline

  _____  

From: ludovic.orban@gmail.com [mailto:ludovic.orban@gmail.com] On Behalf Of
Ludovic Orban
Sent: Tuesday, April 10, 2012 4:45 PM
To: user@btm.codehaus.org
Subject: Re: [btm-user] Problem with Mysql and Mssql

 

You've configured your connection pools using the LRC adapter and by
default, BTM does not allow multiple LRC resources to participate in a
transaction as this gives up the recovery guarantee.

This is definitely not recommended in a production environment, but for
development you can configure BTM to allow this by setting the
allowMultipleLrc config property to true, see:
http://btm.codehaus.org/api/2.1.2/bitronix/tm/Configuration.html#setAllowMul
tipleLrc%28boolean%29

As a reminder: no single transaction manager can guarantee that transactions
involving multiple non-XA resources will result in an atomic outcome. BTM
just very explicitly prevents you from doing this by accident while other
TMs may silently allow this and fail during error recovery.

--
 Ludovic



On Tue, Apr 10, 2012 at 12:28 PM, Caroline <caroline.n@manthansystems.com>
wrote:

Hi

 

I'm trying to use BTM as a transaction manager for mysql and mssql

 

I'm getting the following error.

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a
JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state
ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on
ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in
state NO_TX

 

StackTrace:

 

java.sql.SQLException: error enlisting a JdbcConnectionHandle of a
JdbcPooledConnection from datasource jdbc/ARC_DW_SPA_APP_DEV in state
ACCESSIBLE with usage count 1 wrapping a JDBC LrcXAConnection on
ConnectionID:1 on a JDBC LrcConnectionHandle on a JDBC LrcXAResource in
state NO_TX

      at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnection
Handle.java:86)

      at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.prepareStatement(JdbcConnecti
onHandle.java:243)

      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)

      at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)

      at java.lang.reflect.Method.invoke(Method.java:597)

      at
bitronix.tm.resource.jdbc.BaseProxyHandlerClass.invoke(BaseProxyHandlerClass
.java:63)

      at $Proxy1.prepareStatement(Unknown Source)

      at jtatest.BTMWithMySqlAndMsSql.main(BTMWithMySqlAndMsSql.java:128)

Caused by: bitronix.tm.internal.BitronixSystemException: cannot enlist more
than one non-XA resource, tried enlisting an XAResourceHolderState with
uniqueName=jdbc/ARC_DW_SPA_APP_DEV XAResource=a JDBC LrcXAResource in state
NO_TX with XID null, already enlisted: an XAResourceHolderState with
uniqueName=jdbc/javatest XAResource=a JDBC LrcXAResource in state STARTED
(started) with XID a Bitronix XID
[3137322E32302E312E3933000001369BC3076500000000 :
3137322E32302E312E3933000001369BC3082D00000002]

      at
bitronix.tm.internal.XAResourceManager.enlist(XAResourceManager.java:107)

      at
bitronix.tm.BitronixTransaction.enlistResource(BitronixTransaction.java:93)

      at
bitronix.tm.resource.common.TransactionContextHelper.enlistInCurrentTransact
ion(TransactionContextHelper.java:70)

      at
bitronix.tm.resource.jdbc.JdbcConnectionHandle.enlistResource(JdbcConnection
Handle.java:84)

      ... 8 more

Apr 10, 2012 3:48:31 PM bitronix.tm.BitronixTransactionManager shutdown

INFO: shutting down Bitronix Transaction Manager

 

Can you please help?

 

Thanks,

Caroline

 
Loading...