activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carsten Krebs <>
Subject stale transaction using journaled jdbc and postgresql
Date Fri, 21 Sep 2007 16:36:12 GMT


I have a curious problem, when running ActiveMQ 4.1.1 with a journaled jdbc
adapter using a PostgreSQL as long term persistence store. It looks like,
that ActiveMQ starts a transaction on the database an never commits it. At
present ActiveMQ is able to deliver almost all messages right after arrival,
so there is no need to store any messages in the PostgreSQL, the journal is
Is this the normal behaviour of ActiveMQ? or is there a way to configure
ActiveMQ to just start the transaction on demand and to commit it after some

The problem of the very long running transaction is, that the transaction
locks a transaction id in the database and prevents the database from wiping
out dead rows (VACUUM). For the ActiveMQ schema it doesn't matter, but I
have some more heavily updated tables in other schemas, which needed to be
cleaned up periodically, but as long ActiveMQ doesn't commits the
transaction, the database have no chance to do so.


Below, the broker configuration used.


	<!-- Allows us to use system properties as variables in this configuration
file -->

	<bean id="dataSource"
		<property name="driverClassName" value="org.postgresql.Driver" />
		<property name="url" value="jdbc:postgresql://${}:5432/gd" />
		<property name="defaultCatalog" value="gd" />
		<property name="username" value="activemq" />
		<property name="password" value="activemq" />
		<property name="maxActive" value="15" />
		<property name="initialSize" value="0" />
 		<property name="poolPreparedStatements" value="true" />
		<property name="maxWait" value="0" />
		<property name="defaultAutoCommit" value="false" />
		<property name="minIdle" value="0" />
		<property name="maxIdle" value="0" />
		<property name="timeBetweenEvictionRunsMillis" value="60000" />
		<property name="minEvictableIdleTimeMillis" value="600000" />

	<bean name="jdbcPersistenceAdapter"
		<property name="adapter">
				<property name="batchStatments" value="true" />
		JMS Broker 
	<broker brokerName="jmsBroker" useJmx="true" persistent="true"
		<!-- Use the following to configure how ActiveMQ is exposed in JMX -->
			<managementContext connectorPort="1616"
				jmxDomainName="org.apache.activemq" />

			<journaledJDBC journalLogFiles="10"
				dataSource="#dataSource" />
			<transportConnector name="openwire"
				uri="tcp://${}:61616" />
			<transportConnector name="ssl" uri="ssl://${}:61617" />
			<transportConnector name="stomp"
				uri="stomp://${}:61613" />

			<networkConnector uri="multicast://default" />


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message