activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skomarla <>
Subject use of useDatabaseLock with jdbcPersistenceAdapter
Date Wed, 12 Nov 2008 00:38:12 GMT

Hello everyone,

I'm experimenting with the jdbcPersistenceAdapter and want to understand the
intent of the attribute useDatabaseLock.  I couldn't dig up anything beyond
"Sets whether or not an exclusive database lock should be used to enable
JDBC Master/Slave. Enabled by default. "

I understand the master/slave aspect by setting it to true, but if i set it
to false, do i get an active/active setup in a cluster?

1) activemq 5.1.0 rar is embedded in JBoss 4.2.2
2) here is the relevant portions of broker-config.xml

<beans xmlns="">
<bean xmlns=""

  <bean xmlns="" id="jms-ds"
    <property name="jndiName">

  <broker useJmx="true" brokerName="localhost">

  <managementContext createConnector="false"/>

      <jdbcPersistenceAdapter dataSource="#jms-ds"/>

      <transportConnector name="localhost" uri="tcp://skomarla:61616"/>
      <networkConnector uri="static://(tcp://localhost:61616)"/>


When I have the file configured as above, AMQ obtains the master lock
(SQLServer 2005) and everything is fine and the db is used to store
messages. If I set useDatabaseLock="false" and use a persistent queue, all
the messages still end up in the db.. is this essentially allowing me to get
a master/master.. or rather active/active setup when if I cluster?

If no to the above, what can I do to achieve a master-master setup using a
common database. I've read up on networking the brokers and letting each
broker handle the message or pass it on, but that opens the potential of
message loss in the case of persistence failure (db or disk).  I don't want
to setup master/slave for each broker in the network since that doubles the
# of machines needed.

I know this is really two different questions, but thanks for any input.
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message