BTM and MySQL

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

BTM and MySQL

Mondain
Has anyone here had luck with MySQL and BTM? I'm using BTM 1.3, ConnectorJ 5.1.6, and Spring 2.5.5 and I cant seem to get a valid connection to my local db. My data source is setup like so:

    <bean id="dataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
        <property name="className" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
        <property name="uniqueName" value="jdbc/ds" />
        <property name="minPoolSize" value="2" />
        <property name="maxPoolSize" value="32" />
        <property name="acquisitionInterval" value="1" />
        <property name="acquisitionTimeout" value="15" />
        <property name="maxIdleTime" value="15" />
        <property name="useTmJoin" value="true" />
        <property name="deferConnectionRelease" value="true" />
        <property name="automaticEnlistingEnabled" value="true"/>
        <property name="allowLocalTransactions" value="true"/>
        <property name="testQuery" value="SELECT current_timestamp" />
        <property name="driverProperties">
            <props>
                <prop key="user">MyUser</prop>
                <prop key="password">password</prop>
                <prop key="databaseName">MyDB</prop>
                <prop key="serverName">127.0.0.1</prop>
                <prop key="portNumber">3306</prop>
                <prop key="url">jdbc:mysql://127.0.0.1/MyDB?autoReconnect=true</prop>
            </props>
        </property>
    </bean>   

This particular data source bean has used succesfully with MSSQL and JTDS datasources. I have also tried using com.mysql.jdbc.jdbc2.optional.MysqlXaConnectionPoolDataSource instead of the DS shown, but it failed also.

Thanks,
Paul
Reply | Threaded
Open this post in threaded view
|

Re: BTM and MySQL

lbertrand
I am using ConnectorJ 5.0.8 and it works fine...

With the 5.1.6, you get a NullPointerException from the Connector - it is a bug in the connector, not bitronix...  So revert to 5.0.8 and it will work.

Mondain wrote
Has anyone here had luck with MySQL and BTM? I'm using BTM 1.3, ConnectorJ 5.1.6, and Spring 2.5.5 and I cant seem to get a valid connection to my local db. My data source is setup like so:

    <bean id="dataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
        <property name="className" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
        <property name="uniqueName" value="jdbc/ds" />
        <property name="minPoolSize" value="2" />
        <property name="maxPoolSize" value="32" />
        <property name="acquisitionInterval" value="1" />
        <property name="acquisitionTimeout" value="15" />
        <property name="maxIdleTime" value="15" />
        <property name="useTmJoin" value="true" />
        <property name="deferConnectionRelease" value="true" />
        <property name="automaticEnlistingEnabled" value="true"/>
        <property name="allowLocalTransactions" value="true"/>
        <property name="testQuery" value="SELECT current_timestamp" />
        <property name="driverProperties">
            <props>
                <prop key="user">MyUser</prop>
                <prop key="password">password</prop>
                <prop key="databaseName">MyDB</prop>
                <prop key="serverName">127.0.0.1</prop>
                <prop key="portNumber">3306</prop>
                <prop key="url">jdbc:mysql://127.0.0.1/MyDB?autoReconnect=true</prop>
            </props>
        </property>
    </bean>   

This particular data source bean has used succesfully with MSSQL and JTDS datasources. I have also tried using com.mysql.jdbc.jdbc2.optional.MysqlXaConnectionPoolDataSource instead of the DS shown, but it failed also.

Thanks,
Paul
Reply | Threaded
Open this post in threaded view
|

Re: BTM and MySQL

Mondain
Thanks that worked! I guess 5.1.6 + BTM is broken for now.

Paul

lbertrand wrote
I am using ConnectorJ 5.0.8 and it works fine...

With the 5.1.6, you get a NullPointerException from the Connector - it is a bug in the connector, not bitronix...  So revert to 5.0.8 and it will work.

Mondain wrote
Has anyone here had luck with MySQL and BTM? I'm using BTM 1.3, ConnectorJ 5.1.6, and Spring 2.5.5 and I cant seem to get a valid connection to my local db. My data source is setup like so:

    <bean id="dataSource" class="bitronix.tm.resource.jdbc.PoolingDataSource" init-method="init" destroy-method="close">
        <property name="className" value="com.mysql.jdbc.jdbc2.optional.MysqlXADataSource"/>
        <property name="uniqueName" value="jdbc/ds" />
        <property name="minPoolSize" value="2" />
        <property name="maxPoolSize" value="32" />
        <property name="acquisitionInterval" value="1" />
        <property name="acquisitionTimeout" value="15" />
        <property name="maxIdleTime" value="15" />
        <property name="useTmJoin" value="true" />
        <property name="deferConnectionRelease" value="true" />
        <property name="automaticEnlistingEnabled" value="true"/>
        <property name="allowLocalTransactions" value="true"/>
        <property name="testQuery" value="SELECT current_timestamp" />
        <property name="driverProperties">
            <props>
                <prop key="user">MyUser</prop>
                <prop key="password">password</prop>
                <prop key="databaseName">MyDB</prop>
                <prop key="serverName">127.0.0.1</prop>
                <prop key="portNumber">3306</prop>
                <prop key="url">jdbc:mysql://127.0.0.1/MyDB?autoReconnect=true</prop>
            </props>
        </property>
    </bean>   

This particular data source bean has used succesfully with MSSQL and JTDS datasources. I have also tried using com.mysql.jdbc.jdbc2.optional.MysqlXaConnectionPoolDataSource instead of the DS shown, but it failed also.

Thanks,
Paul
Reply | Threaded
Open this post in threaded view
|

Re: BTM and MySQL

Ludovic Orban
Administrator
An issue has been opened some time ago regarding MySql: http://jira.codehaus.org/browse/BTM-15. I advise you to read it carefully as it contains useful information regarding MySQL and XA.

Unfortunately while the JDBC driver version 5.0.8 seems to work fine, MySQL's XA support is still insufficient to be considered usable on production IMHO.

Ludovic
Reply | Threaded
Open this post in threaded view
|

Re: BTM and MySQL

Mondain
Thanks Ludovic, I will certainly keep that in-mind.. luckily we're only using it to test for this particular project.

Paul

Ludovic Orban wrote
An issue has been opened some time ago regarding MySql: http://jira.codehaus.org/browse/BTM-15. I advise you to read it carefully as it contains useful information regarding MySQL and XA.

Unfortunately while the JDBC driver version 5.0.8 seems to work fine, MySQL's XA support is still insufficient to be considered usable on production IMHO.

Ludovic