JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-3483

Exception Using XA Transactions With JDBC Connector (Mule transaction is null, but enlist method is called)

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Trivial Trivial
  • Resolution: Won't Fix or Usage Issue
  • Affects Version/s: 1.4.4
  • Fix Version/s: None
  • Component/s: Modules: XA Transactions, Transport: JDBC
  • Labels:
    None
  • Environment:

    OS: Windows XP Pro
    DB: Oracle 10g
    JDBC Jar: ojdbc14-10.2.0.jar
    JDK 1.6

  • User impact:
    Medium
  • Configuration:
    Hide

    <!-- XA Datasource Configuration -->

    <beans>
    <bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"/>
    <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    <property name="userTransaction" ref="jotm"/>
    <property name="transactionManager" ref="jotm"/>
    </bean>

    <bean id="MAFXADataSource" class="org.mule.providers.jdbc.xa.DataSourceWrapper">
    <constructor-arg ref="xaDataSource"/>
    <constructor-arg ref="jotm"/>
    </bean>

    <bean id="xaDataSource" class="oracle.jdbc.xa.client.OracleXADataSource" destroy-method="shutdown">
    <property name="URL" value="jdbc:oracle:thin:@localhost:1521:Xe" />
    <property name="user" value="USERNAME"/>
    <property name="password" value="PASSWORD"/>
    </bean>
    </beans>

    <!-- Connector Configuration -->

    <!-- Configure the JDBC connector -->
    <connector name="jdbcConnector" className="org.mule.providers.jdbc.JdbcConnector">
    <properties>
    <container-property name="dataSource" reference="MAFXADataSource"/>
    <property name="pollingFrequency" value="10000"/>
    <map name="queries">
    <property name="getConsumerDemoRecs" value="SELECT CURRENCY FROM consumerdemo where MSGID='1'"/>
    </map>
    </properties>
    </connector>

    <!-- Endpoint Configuration -->

    <endpoint name="JDBC_GetConsumerDemoRecs" address="jdbc://getConsumerDemoRecs" transformers="MessageWrapper">
    <transaction action="ALWAYS_BEGIN" factory="org.mule.transaction.XaTransactionFactory"/>
    </endpoint>

    <!-- Transaction Manager Configuration -->
    <transaction-manager factory="org.mule.extras.jotm.JotmTransactionManagerFactory"/>

    <!-- Mule model Configuration -->

    <model name="Mule-app">

    <mule-descriptor name="XADB_Test_Component" implementation="xaDBTest">
    <inbound-router>
    <global-endpoint name="JDBC_GetConsumerDemoRecs"/>
    </inbound-router>
    </mule-descriptor>
    </model>

    Show
    <!-- XA Datasource Configuration --> <beans> <bean id="jotm" class="org.springframework.transaction.jta.JotmFactoryBean"/> <bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager"> <property name="userTransaction" ref="jotm"/> <property name="transactionManager" ref="jotm"/> </bean> <bean id="MAFXADataSource" class="org.mule.providers.jdbc.xa.DataSourceWrapper"> <constructor-arg ref="xaDataSource"/> <constructor-arg ref="jotm"/> </bean> <bean id="xaDataSource" class="oracle.jdbc.xa.client.OracleXADataSource" destroy-method="shutdown"> <property name="URL" value="jdbc:oracle:thin:@localhost:1521:Xe" /> <property name="user" value="USERNAME"/> <property name="password" value="PASSWORD"/> </bean> </beans> <!-- Connector Configuration --> <!-- Configure the JDBC connector --> <connector name="jdbcConnector" className="org.mule.providers.jdbc.JdbcConnector"> <properties> <container-property name="dataSource" reference="MAFXADataSource"/> <property name="pollingFrequency" value="10000"/> <map name="queries"> <property name="getConsumerDemoRecs" value="SELECT CURRENCY FROM consumerdemo where MSGID='1'"/> </map> </properties> </connector> <!-- Endpoint Configuration --> <endpoint name="JDBC_GetConsumerDemoRecs" address="jdbc://getConsumerDemoRecs" transformers="MessageWrapper"> <transaction action="ALWAYS_BEGIN" factory="org.mule.transaction.XaTransactionFactory"/> </endpoint> <!-- Transaction Manager Configuration --> <transaction-manager factory="org.mule.extras.jotm.JotmTransactionManagerFactory"/> <!-- Mule model Configuration --> <model name="Mule-app"> <mule-descriptor name="XADB_Test_Component" implementation="xaDBTest"> <inbound-router> <global-endpoint name="JDBC_GetConsumerDemoRecs"/> </inbound-router> </mule-descriptor> </model>
  • Log Output:
    Hide
    2008-06-25 11:09:09,232 (MuleManager.java:900) INFO org.mule.MuleManager -
    **********************************************************************
    * Mule ESB and Integration Platform *
    * Version: 1.4.4 Build: 11748 *
    * MuleSource, Inc. *
    * For more information go to http://mule.mulesource.org *
    * *
    * Server started: 25/06/08 11:09 *
    * Server ID: MAF-config *
    * JDK: 1.6.0_04 (mixed mode, sharing) *
    * OS: Windows XP - Service Pack 2 (5.1, x86) *
    * Host: LGLAIB8HBBJ2J (169.24.29.131) *
    * *
    * Agents Running: *
    * JMX Agent *
    * Wrapper Manager: Mule PID #3920, Wrapper PID #3940 *
    **********************************************************************
    2008-06-25 11:09:09,232 (MuleServer.java:300) INFO org.mule.MuleServer - Mule Server initialized.
    2008-06-25 11:09:10,420 (AbstractExceptionListener.java:310) ERROR org.mule.impl.DefaultExceptionStrategy -
    ********************************************************************************
    Message : Mule transaction is null, but enlist method is called
    Type : org.mule.transaction.IllegalTransactionStateException
    Code : MULE_ERROR-91530
    JavaDoc : http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html
    ********************************************************************************
    Exception stack is:
    1. Mule transaction is null, but enlist method is called (org.mule.transaction.IllegalTransactionStateException)
      org.mule.providers.jdbc.xa.ConnectionWrapper:463 (http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html)
    ********************************************************************************
    Root Exception stack trace:
    org.mule.transaction.IllegalTransactionStateException: Mule transaction is null, but enlist method is called
            at org.mule.providers.jdbc.xa.ConnectionWrapper.enlist(ConnectionWrapper.java:463)
            at org.mule.providers.jdbc.xa.StatementInvocationHandler.invoke(StatementInvocationHandler.java:40)
            at $Proxy0.executeQuery(Unknown Source)
            at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:236)
            at org.mule.providers.jdbc.JdbcMessageReceiver.getMessages(JdbcMessageReceiver.java:154)
            at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:136)
            at org.mule.providers.PollingReceiverWorker.run(PollingReceiverWorker.java:47)
            at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)
            at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)
            at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)
            at java.lang.Thread.run(Thread.java:619)

    ********************************************************************************
    Show
    2008-06-25 11:09:09,232 (MuleManager.java:900) INFO org.mule.MuleManager - ********************************************************************** * Mule ESB and Integration Platform * * Version: 1.4.4 Build: 11748 * * MuleSource, Inc. * * For more information go to http://mule.mulesource.org * * * * Server started: 25/06/08 11:09 * * Server ID: MAF-config * * JDK: 1.6.0_04 (mixed mode, sharing) * * OS: Windows XP - Service Pack 2 (5.1, x86) * * Host: LGLAIB8HBBJ2J (169.24.29.131) * * * * Agents Running: * * JMX Agent * * Wrapper Manager: Mule PID #3920, Wrapper PID #3940 * ********************************************************************** 2008-06-25 11:09:09,232 (MuleServer.java:300) INFO org.mule.MuleServer - Mule Server initialized. 2008-06-25 11:09:10,420 (AbstractExceptionListener.java:310) ERROR org.mule.impl.DefaultExceptionStrategy - ******************************************************************************** Message : Mule transaction is null, but enlist method is called Type : org.mule.transaction.IllegalTransactionStateException Code : MULE_ERROR-91530 JavaDoc : http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html ******************************************************************************** Exception stack is: 1. Mule transaction is null, but enlist method is called (org.mule.transaction.IllegalTransactionStateException)   org.mule.providers.jdbc.xa.ConnectionWrapper:463 (http://mule.mulesource.org/docs/apidocs/org/mule/transaction/IllegalTransactionStateException.html) ******************************************************************************** Root Exception stack trace: org.mule.transaction.IllegalTransactionStateException: Mule transaction is null, but enlist method is called         at org.mule.providers.jdbc.xa.ConnectionWrapper.enlist(ConnectionWrapper.java:463)         at org.mule.providers.jdbc.xa.StatementInvocationHandler.invoke(StatementInvocationHandler.java:40)         at $Proxy0.executeQuery(Unknown Source)         at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:236)         at org.mule.providers.jdbc.JdbcMessageReceiver.getMessages(JdbcMessageReceiver.java:154)         at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:136)         at org.mule.providers.PollingReceiverWorker.run(PollingReceiverWorker.java:47)         at org.mule.impl.work.WorkerContext.run(WorkerContext.java:310)         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1061)         at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:575)         at java.lang.Thread.run(Thread.java:619) ********************************************************************************
  • Similar Issues:
    None

Description

As part of my application (running on Mule 1.4.4) I am trying to use the JDBC connector to read some information from the database and then continue to process that information all inside of an XA Transaction. Any time I try to use the JDBC Connector under an XA Transaction I get the "Mule transaction is null, but enlist method is called" error.

I created the example configuration above to try and isolate the error. The example configuration works on Mule 1.4.3 but fails with the "Mule transaction is null, but enlist method is called" error on 1.4.4.

Also, when I run the above on Mule 1.4.4 without transactions it works successfully.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Andrew Perepelytsya added a comment - 25/Jun/08 12:25 PM

This is typically a misconfiguration. 1.4.4 is more strict with this case, as it's really an error, and proceeding would cause unexpected results. I don't see why you'd use the DataSourceWrapper. What happened when you used OracleDataSource?

Show
Andrew Perepelytsya added a comment - 25/Jun/08 12:25 PM This is typically a misconfiguration. 1.4.4 is more strict with this case, as it's really an error, and proceeding would cause unexpected results. I don't see why you'd use the DataSourceWrapper. What happened when you used OracleDataSource?
Hide
Permalink
Nicol McKenna added a comment - 26/Jun/08 04:10 AM

Hi Andrew,

I was using the DataSourceWrapper based on an example I'd found online around Mule and XA transactions with JDBC.

If I strip out the DataSourceWrapper and use the oracle.jdbc.xa.client.OracleXADataSource directly then I get the same error. If, as you suggested I use the oracle.jdbc.pool.OracleDataSource then the problem goes away and the app seems to work.

I have a question about this though - is using the OracleDataSource enough to take part in the XA transaction in Mule ? Or would you not have to use the OracleXADataSource to take part in XA Transactions?

Thanks.

Show
Nicol McKenna added a comment - 26/Jun/08 04:10 AM Hi Andrew, I was using the DataSourceWrapper based on an example I'd found online around Mule and XA transactions with JDBC. If I strip out the DataSourceWrapper and use the oracle.jdbc.xa.client.OracleXADataSource directly then I get the same error. If, as you suggested I use the oracle.jdbc.pool.OracleDataSource then the problem goes away and the app seems to work. I have a question about this though - is using the OracleDataSource enough to take part in the XA transaction in Mule ? Or would you not have to use the OracleXADataSource to take part in XA Transactions? Thanks.
Hide
Permalink
Pablo Kraan added a comment - 21/Oct/11 01:59 PM

Affects mule 1.4.4, no feedback in 3 years, closing

Show
Pablo Kraan added a comment - 21/Oct/11 01:59 PM Affects mule 1.4.4, no feedback in 3 years, closing

People

  • Assignee:
    Pablo Kraan
    Reporter:
    Nicol McKenna
Vote (0)
Watch (1)

Dates

  • Created:
    25/Jun/08 10:07 AM
    Updated:
    21/Oct/11 01:59 PM
    Resolved:
    21/Oct/11 01:59 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.