You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Stephan Brunner (JIRA)" <ji...@apache.org> on 2008/05/07 10:57:43 UTC

[jira] Reopened: (AMQ-711) commit() should not be called while in auto-commit mode

     [ https://issues.apache.org/activemq/browse/AMQ-711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stephan Brunner reopened AMQ-711:
---------------------------------

    Regression: [Regression]

Hi folks!

I'm getting the same or similar exception with activemq 5.0.0 distribution. I'm using mssqlserver 2000 with jtds 1.2 lib. Btw I've tried same application context with activemq  4.1.1 distribution and it works perfectly

I'm getting the following exception:

2008-05-05 16:03:38,812 [main           ] ERROR BrokerService                  - Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: commit() should not be called while in auto-commit mode.
java.io.IOException: commit() should not be called while in auto-commit mode.
	at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:45)
	at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.deleteAllMessages(JDBCPersistenceAdapter.java:389)
	at org.apache.activemq.broker.BrokerService.deleteAllMessages(BrokerService.java:1004)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:415)
	at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:46)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
	at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
	at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:91)
	at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:51)
	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
	at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
	at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:112)
	at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:51)
	at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:104)
	at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:51)
	at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:76)
	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 org.apache.activemq.console.Main.runTaskClass(Main.java:222)
	at org.apache.activemq.console.Main.main(Main.java:106)
Caused by: java.sql.SQLException: commit() should not be called while in auto-commit mode.
	at net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:1878)
	at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
	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.adapter.DefaultJDBCAdapter.doDropTables(DefaultJDBCAdapter.java:133)
	at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.deleteAllMessages(JDBCPersistenceAdapter.java:384)

My Application Context for the persistency adapter is:

<persistenceAdapter adapterClass="org.apache.activemq.store.jdbc.adapter.ImageBasedJDBCAdaptor">
		<journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#jtds-ds" useDatabaseLock="false"/>
</persistenceAdapter>

and my datasource is:

  <bean id="jtds-ds" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
	<property name="serverName" value="****"/>
	<property name="portNumber" value="****"/>
	<property name="databaseName" value="*****"/>
	<property name="user" value="****"/>
	<property name="password" value="***"/>
</bean>

thanks, 

stephan



> commit() should not be called while in auto-commit mode
> -------------------------------------------------------
>
>                 Key: AMQ-711
>                 URL: https://issues.apache.org/activemq/browse/AMQ-711
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.0 RC2, 4.0 RC3
>         Environment: Windows NT
> SQLServer with jtds driver. 
>            Reporter: Niklas Käck
>             Fix For: 4.0.1, 4.1.0
>
>         Attachments: activemq.xml
>
>   Original Estimate: 1 day
>  Remaining Estimate: 1 day
>
> Unable to startup Broker Service.
> ERROR BrokerService                  - Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: commit() should not be called while in auto-commit mode.
> Stacktrace:
> java.io.IOException: commit() should not be called while in auto-commit mode.
>         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:907)
>         at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:867)
>         at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:453)
>         at org.apache.activemq.broker.BrokerService.start(BrokerService.java:362)
>         at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:43)
>         at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058
> )
>         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:318)
>         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:64)
>         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(NativeMethodAccessorImpl.java:39)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:585)
>         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: commit() should not be called while in auto-commit mode.
>         at net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:1878)
>         at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
>         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)
> Error message:
> ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean
> with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class path resource [activemq.xml]: Initialization of bean failed; nested exceptio
> n is java.io.IOException: commit() should not be called while in auto-commit mode.
> ERROR: java.lang.Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBro
> kerService' defined in class path resource [activemq.xml]: Initialization of bean failed; nested exception is java.io.IOException: commit() should not
>  be called while in auto-commit mode.
> Configuration:
> <bean id="sqlserver-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
>       <property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
>       <property name="url" value="jdbc:jtds:sqlserver://host/ActiveMQ;instance=D1;tds=8.0;lastupdatecount=true"/>
>       <property name="username" value="ActiveMQ"/>
>       <property name="password" value="ActiveMQPwd"/>
>       <property name="poolPreparedStatements" value="true"/>
>   </bean>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.