activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chad Brandon (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AMQ-368) Database Connection Leaks
Date Wed, 14 Feb 2007 01:47:04 GMT

    [ https://issues.apache.org/activemq/browse/AMQ-368?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38502
] 

Chad Brandon commented on AMQ-368:
----------------------------------

The bug apparents to be in commons-dbcp (I'm seeing the issue myself), it occurs when you
set  <property name="poolPreparedStatements" value="true"/> (if you remove it or set
to false, dbcp correctly keeps the connecton count to the maxActive setting), ActiveMQ guys
you might want to remove this "poolPreparedStatements" setting from your MySQL datasource
examples (that's the reason I had it there in the first place).

> Database Connection Leaks
> -------------------------
>
>                 Key: AMQ-368
>                 URL: https://issues.apache.org/activemq/browse/AMQ-368
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 3.1
>         Environment: java version "1.5.0_04"
>            Reporter: Daniel Aioanei
>         Assigned To: Hiram Chirino
>            Priority: Critical
>
> The activemq server seems to be leaking database connections:
> 2005-09-22 19:01:51,109 [ocalport=61616]] WARN  BrokerClientImpl               - caught
exception consuming packet: ACTIVEMQ_OBJECT_MESSAGE: id = 185 ActiveMQMessage{ , jmsMessageID
= ID:AMT915-1611-1127395790823-44:19, bodyAsBytes = org.activemq.io.util.ByteArray@16de067,
readOnlyMessage = false, jmsClientID = 'ID:AMT915-1611-1127395790823-9:0' , jmsCorrelationID
= 'null' , jmsDestination = SmsGateway.OutboundQueue, jmsReplyTo = null, jmsDeliveryMode =
2, jmsRedelivered = false, jmsType = 'null' , jmsExpiration = 0, jmsPriority = 4, jmsTimestamp
= 1127395909844, properties = {esmeId=3, callId=70867}, readOnlyProperties = false, entryBrokerName
= 'ID:AMT915-1055-1127393936629-0:0' , entryClusterName = 'default' , consumerNos = null,
transactionId = 'null' , xaTransacted = false, consumerIdentifer = 'null' , messageConsumed
= false, transientConsumed = false, sequenceNumber = 19, deliveryCount = 1, dispatchedFromDLQ
= false, messageAcknowledge = null, jmsMessageIdentity = null, producerKey = ID:AMT915-1611-1127395790823-44:
} ActiveMQObjectMessage{ object = {destAddress=919811771123, userDataHeader=[B@15fb38, sourceAddress=111,
charset=US-ASCII, userDataBinary=[B@120540c} }
> javax.jms.JMSException: Failed to broker message: ID:AMT915-1611-1127395790823-44:19
in container: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.activemq.util.JMSExceptionHelper.newJMSException(JMSExceptionHelper.java:49)
> 	at org.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessageStore.java:74)
> 	at org.activemq.store.vm.VMTransactionStore.addMessage(VMTransactionStore.java:230)
> 	at org.activemq.store.vm.VMTransactionStore$1.addMessage(VMTransactionStore.java:118)
> 	at org.activemq.store.cache.CacheMessageStore.addMessage(CacheMessageStore.java:51)
> 	at org.activemq.service.boundedvm.DurableQueueBoundedMessageContainer.enqueue(DurableQueueBoundedMessageContainer.java:218)
> 	at org.activemq.service.boundedvm.DurableQueueBoundedMessageManager.sendMessage(DurableQueueBoundedMessageManager.java:302)
> 	at org.activemq.broker.impl.DefaultBroker.doMessageSend(DefaultBroker.java:566)
> 	at org.activemq.broker.impl.DefaultBroker.sendMessage(DefaultBroker.java:305)
> 	at org.activemq.broker.impl.BrokerContainerImpl.sendMessage(BrokerContainerImpl.java:462)
> 	at org.activemq.broker.impl.BrokerConnectorImpl.sendMessage(BrokerConnectorImpl.java:272)
> 	at org.activemq.broker.impl.BrokerClientImpl.consumeActiveMQMessage(BrokerClientImpl.java:722)
> 	at org.activemq.broker.impl.BrokerClientImpl.consume(BrokerClientImpl.java:323)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:374)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:368)
> 	at org.activemq.transport.tcp.TcpTransportChannel.run(TcpTransportChannel.java:311)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:443)
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:98)
> 	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
> 	at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
> 	at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
> 	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
> 	at org.postgresql.Driver.connect(Driver.java:235)
> 	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
> 	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
> 	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:544)
> 	at org.activemq.store.jdbc.JDBCPersistenceAdapter.getConnection(JDBCPersistenceAdapter.java:312)
> 	at org.activemq.store.jdbc.JDBCMessageStore.addMessage(JDBCMessageStore.java:71)
> 	... 15 more
> 2005-09-22 19:01:51,656 [ocalport=61616]] WARN  BrokerClientImpl               - caught
exception consuming packet: TRANSACTION_INFO: id = 283 TransactionInfo{ transactionId = 'ID:AMT915-1611-1127395790823-30:9'
, type = 103 }
> javax.jms.JMSException
> 	at org.activemq.broker.impl.DefaultBroker.commitTransaction(DefaultBroker.java:352)
> 	at org.activemq.broker.impl.BrokerContainerImpl.commitTransaction(BrokerContainerImpl.java:449)
> 	at org.activemq.broker.impl.BrokerConnectorImpl.commitTransaction(BrokerConnectorImpl.java:261)
> 	at org.activemq.broker.impl.BrokerClientImpl.consumeTransactionInfo(BrokerClientImpl.java:751)
> 	at org.activemq.broker.impl.BrokerClientImpl.consume(BrokerClientImpl.java:340)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:374)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:368)
> 	at org.activemq.transport.tcp.TcpTransportChannel.run(TcpTransportChannel.java:311)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.xa.XAException
> 	at org.activemq.store.vm.VMTransactionStore$Tx.commit(VMTransactionStore.java:100)
> 	at org.activemq.store.vm.VMTransactionStore.commit(VMTransactionStore.java:172)
> 	at org.activemq.service.impl.LocalTransactionCommand.commit(LocalTransactionCommand.java:66)
> 	at org.activemq.broker.impl.DefaultBroker.commitTransaction(DefaultBroker.java:348)
> 	... 8 more
> Caused by: javax.jms.JMSException: Failed to broker message: ID:AMT915-1611-1127395790823-47:9
in container: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.activemq.util.JMSExceptionHelper.newJMSException(JMSExceptionHelper.java:49)
> 	at org.activemq.store.jdbc.JDBCMessageStore.removeMessage(JDBCMessageStore.java:151)
> 	at org.activemq.store.vm.VMTransactionStore$4.run(VMTransactionStore.java:249)
> 	at org.activemq.store.vm.VMTransactionStore$Tx.commit(VMTransactionStore.java:97)
> 	... 11 more
> Caused by: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:443)
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:98)
> 	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
> 	at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
> 	at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
> 	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
> 	at org.postgresql.Driver.connect(Driver.java:235)
> 	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
> 	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
> 	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:544)
> 	at org.activemq.store.jdbc.JDBCPersistenceAdapter.getConnection(JDBCPersistenceAdapter.java:312)
> 	at org.activemq.store.jdbc.JDBCMessageStore.removeMessage(JDBCMessageStore.java:148)
> 	... 13 more
> 2005-09-22 19:01:51,765 [ocalport=61616]] WARN  BrokerClientImpl               - caught
exception consuming packet: TRANSACTION_INFO: id = 286 TransactionInfo{ transactionId = 'ID:AMT915-1611-1127395790823-24:9'
, type = 103 }
> javax.jms.JMSException
> 	at org.activemq.broker.impl.DefaultBroker.commitTransaction(DefaultBroker.java:352)
> 	at org.activemq.broker.impl.BrokerContainerImpl.commitTransaction(BrokerContainerImpl.java:449)
> 	at org.activemq.broker.impl.BrokerConnectorImpl.commitTransaction(BrokerConnectorImpl.java:261)
> 	at org.activemq.broker.impl.BrokerClientImpl.consumeTransactionInfo(BrokerClientImpl.java:751)
> 	at org.activemq.broker.impl.BrokerClientImpl.consume(BrokerClientImpl.java:340)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:374)
> 	at org.activemq.transport.TransportChannelSupport.doConsumePacket(TransportChannelSupport.java:368)
> 	at org.activemq.transport.tcp.TcpTransportChannel.run(TcpTransportChannel.java:311)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: javax.transaction.xa.XAException
> 	at org.activemq.store.vm.VMTransactionStore$Tx.commit(VMTransactionStore.java:100)
> 	at org.activemq.store.vm.VMTransactionStore.commit(VMTransactionStore.java:172)
> 	at org.activemq.service.impl.LocalTransactionCommand.commit(LocalTransactionCommand.java:66)
> 	at org.activemq.broker.impl.DefaultBroker.commitTransaction(DefaultBroker.java:348)
> 	... 8 more
> Caused by: javax.jms.JMSException: Failed to broker message: ID:AMT915-1611-1127395790823-50:9
in container: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.activemq.util.JMSExceptionHelper.newJMSException(JMSExceptionHelper.java:49)
> 	at org.activemq.store.jdbc.JDBCMessageStore.getMessageSequenceId(JDBCMessageStore.java:134)
> 	at org.activemq.store.jdbc.JDBCMessageStore.removeMessage(JDBCMessageStore.java:143)
> 	at org.activemq.store.vm.VMTransactionStore$4.run(VMTransactionStore.java:249)
> 	at org.activemq.store.vm.VMTransactionStore$Tx.commit(VMTransactionStore.java:97)
> 	... 11 more
> Caused by: org.postgresql.util.PSQLException: Backend start-up failed: FATAL: connection
limit exceeded for non-superusers.
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.readStartupMessages(ConnectionFactoryImpl.java:443)
> 	at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:98)
> 	at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
> 	at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:117)
> 	at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:30)
> 	at org.postgresql.jdbc3.Jdbc3Connection.<init>(Jdbc3Connection.java:24)
> 	at org.postgresql.Driver.connect(Driver.java:235)
> 	at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:37)
> 	at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:290)
> 	at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:771)
> 	at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:95)
> 	at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:544)
> 	at org.activemq.store.jdbc.JDBCPersistenceAdapter.getConnection(JDBCPersistenceAdapter.java:312)
> 	at org.activemq.store.jdbc.JDBCMessageStore.getMessageSequenceId(JDBCMessageStore.java:127)
> 	... 14 more
> Here's the activemq config file:
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE beans PUBLIC  "-//ACTIVEMQ//DTD//EN" "http://activemq.org/dtd/activemq.dtd">
> <beans>
>   
>   <!-- ==================================================================== -->
>   <!-- ActiveMQ Broker Configuration -->
>   <!-- ==================================================================== -->
>   <broker>
>     <connector>
>       <tcpServerTransport uri="tcp://localhost:61616" backlog="1000" maxOutstandingMessages="50"/>
>     </connector>
>     <persistence>
>       <cachePersistence>
>           <jdbcPersistence dataSourceRef="postgres-ds"/>
>       </cachePersistence>
>     </persistence>
> 	<!-- Approximately one day -->
> 	<redeliveryPolicy maximumRetryCount="100" backOffMode="true" backOffIncreaseRate="1.1"
initialRedeliveryTimeout="1000"/>
>   </broker>
>   <!-- ==================================================================== -->
>   <!-- JDBC DataSource Configurations -->
>   <!-- ==================================================================== -->
>   <bean id="postgres-ds"
>     class="org.apache.commons.dbcp.BasicDataSource"
>     destroy-method="close">
>     <property name="driverClassName">
>       <value>org.postgresql.Driver</value>
>     </property>
>     <property name="url">
>       <value>jdbc:postgresql://localhost:5432/activemq</value>
>     </property>
>     <property name="username">
>       <value>username</value>
>     </property>
>     <property name="password">
>       <value>password</value>
>     </property>
>     <property name="maxActive">
>       <value>20</value>
>     </property>
>     <property name="maxIdle">
>       <value>10</value>
>     </property>
>     <property name="maxWait">
>       <value>120000</value>
>     </property>
>     <property name="testWhileIdle">
>       <value>true</value>
>     </property>
>     <property name="validationQuery">
>       <value>select 1</value>
>     </property>
>     <property name="poolPreparedStatements">
>       <value>true</value>
>     </property>
>   </bean>
> </beans>
> In case it might be relevant, I post JMS object messages concurrently from some Tomcat
HTTP processor threads with 100 concurrent users and at the same time I have a message driven
POJO consuming messages from the same persistent queue, in the same tomcat, in a different
Tomcat context. Both use the same JMS connection factory configuration:
>   <Resource name="jms/MessagingGatewayJms" auth="Container"
> 	type="org.activemq.ActiveMQConnectionFactory"
> 	description="bla bla bla"
>         factory="org.activemq.jndi.JNDIReferenceFactory"
> 	brokerURL="reliable://tcp://localhost:61616"
> 	useAsyncSend="false"/> 

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


Mime
View raw message