activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anders5737 <anders.eriks...@gmail.com>
Subject Failing to start broker due to commit without transaction in JDBC store
Date Mon, 19 Jun 2006 22:10:26 GMT

Hello!

I am trying to use AMQ 4.0.0 with persistence to Informix 10.00.UC3R1ET and
JDBC Driver 3.00.JC3 on Linux and I cant even start the broker without the
exception below. It looks like AMQ is doing a commit on connection without
transaction. 

Peeking into the source
https://svn.apache.org/repos/asf/incubator/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/store/jdbc/TransactionContext.java

I found this fishy comment together with the code.

    public void close() throws IOException {
        if( !inTx ) {
            try {
                
                /**
                 * we are not in a transaction so should not be committing
??
                 * This was previously commented out - but had
                 * adverse affects on testing - so it's back!
                 * 
                 */
                try{
                    executeBatch();
                } finally {
                    if (connection != null && !connection.getAutoCommit()) {
                        connection.commit();
                    }
                }
...

Could it be that the state of variable inTx is incorrect? 

I have searched for anyone else getting this but didn't find anything... So
perhaps I am doing something wrong or could it be something special with
Informix? I have tried several logging modes on Informix database and tried
to tweak parameters on the datasource in activemq.xml for DBCP (for example
adding     <property name="defaultAutoCommit" value="false"/> ) . The last
variant looks like this: 

  <bean id="ifmx-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
    <property name="driverClassName" value="com.informix.jdbc.IfxDriver"/>
    <property name="url"
value="jdbc:informix-sqli://localhost:1529/activemq:informixserver=ol_pyro"/>
    <property name="username" value="activemq"/>
    <property name="password" value="activemq"/>
  </bean>

Do you have details on Informix' settings on database (logging mode and
such), parameters for JDBC connection, parameters for DBCP or AMQ or perhaps
any particular Informix environment variables to use???

Is there a way to trace all SQL from AMQ so that I could verify sequence of
SQL outside AMQ?

Thanks in advance, 

Anders



activemq@pyro:/opt/activemq/incubator-activemq-4.0/bin$ ./activemq &
[1] 5346
activemq@pyro:/opt/activemq/incubator-activemq-4.0/bin$ ACTIVEMQ_HOME:
/opt/activemq/incubator-activemq-4.0
Loading message broker from: xbean:activemq.xml
INFO  BrokerService                  - ActiveMQ 4.0 JMS Message Broker
(localhost) is starting
INFO  BrokerService                  - For help or more information please
see: http://incubator.apache.org/activemq/
INFO  JDBCPersistenceAdapter         - Database driver recognized:
[ibm_informix_jdbc_driver_for_ibm_informix_dynamic_server]
ERROR BrokerService                  - Failed to start ActiveMQ JMS Message
Broker. Reason: java.io.IOException: Not in transaction.
java.io.IOException: Not in transaction.
        at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:42)
        at
org.apache.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:125)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBCPersistenceAdapter.java:253)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:213)
        at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:139)
        at
org.apache.activemq.store.journal.JournalPersistenceAdapter.start(JournalPersistenceAdapter.java:215)
        at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:930)
        at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:888)
        at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:458)
        at
org.apache.activemq.broker.BrokerService.start(BrokerService.java:361)
        at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:43)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1059)
        at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
        at
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
        at
org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
        at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:320)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
        at
org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:48)
        at
org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:40)
        at
org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:56)
        at
org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:81)
        at
org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:46)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:49)
        at
org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:81)
        at
org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:49)
        at
org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.apache.activemq.console.Main.runTaskClass(Main.java:135)
        at org.apache.activemq.console.Main.main(Main.java:67)
Caused by: java.sql.SQLException: Not in transaction.
        at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
        at com.informix.jdbc.IfxSqli.a(IfxSqli.java:3208)
        at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3518)
        at com.informix.jdbc.IfxSqli.dispatchMsg(IfxSqli.java:2353)
        at com.informix.jdbc.IfxSqli.receiveMessage(IfxSqli.java:2269)
        at com.informix.jdbc.IfxSqli.executeCommit(IfxSqli.java:493)
        at com.informix.jdbc.IfxSqliConnect.commit(IfxSqliConnect.java:1668)
        at
org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
        at
org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:199)
        at
org.apache.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:119)
        ... 31 more
Caused by: java.sql.SQLException
        at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:373)
        at com.informix.jdbc.IfxSqli.E(IfxSqli.java:3523)

--
View this message in context: http://www.nabble.com/Failing-to-start-broker-due-to-commit-without-transaction-in-JDBC-store-t1814360.html#a4945774
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message