activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From belpel <>
Subject Dead Lock Useing Jdbc database store in transaction mode?
Date Fri, 06 Dec 2013 14:43:43 GMT
I hava on topic with a lot of producers and 1 durable subscribe consumer. 
activemq conneted to mysql with c3p0 datasoure pool with the default
configuration.   The jdbcPersistenceAdapter  cleanupPeriod is 3000。 when all
producers commit message, sometimes activemq blocked, no message can send or
received,even all produces are shutdown. going into stack all produces

and a clean thead blocked

Thread 18234: (state = BLOCKED)
 - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be
 - com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(long)
@bci=171, line=1315 (Compiled frame)
@bci=231, line=557 (Compiled frame)
 - com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(long)
@bci=2, line=477 (Compiled frame)
@bci=9, line=525 (Compiled frame)
 - com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection()
@bci=7, line=128 (Compiled frame)
@bci=12, line=58 (Compiled frame)
@bci=50, line=824 (Compiled frame)
 - @bci=22,
line=345 (Compiled frame)

Look into the souce code, I find
producer submit step : 
begin transaction(get a connection) -->  insert/delete every message  before
get a cleanupExclusiveLock read lock ---> release read lock --> commit --->
close connection;
cleanup task step :  get cleanupExclusiveLock write lock---> get a datasouce
connection ---> delete expired topic messages --> commit --> release write

Produces get all the connections of the pool and waiting for the clearup
task release write lock, while the clearup task got the write lock waiting
for a connection.  is it a dead lock? why the clear up thread get a
datasouce connection first?

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

View raw message