You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by skomarla <sk...@yahoo.com> on 2008/11/12 01:38:12 UTC

use of useDatabaseLock with jdbcPersistenceAdapter

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="http://activemq.apache.org/schema/core">
<bean xmlns=""
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>

  <bean xmlns="" id="jms-ds"
class="org.springframework.jndi.JndiObjectFactoryBean">
    <property name="jndiName">
       <value>java:/my-xa-ds</value>
    </property>
  </bean>

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

<managementContext>
  <managementContext createConnector="false"/>
</managementContext>

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

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

</beans>

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: http://www.nabble.com/use-of-useDatabaseLock-with-jdbcPersistenceAdapter-tp20451739p20451739.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.