activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruce Snyder <>
Subject Re: Is there JDBC master/slave retry logic if database goes down?
Date Tue, 10 Mar 2009 19:17:00 GMT
On Tue, Mar 10, 2009 at 12:15 PM, magellings <> wrote:
> Hello.
> Does anyone know if there is logic in activeMQ to retry connecting to a
> database if JDBC master/slave is configured?  Perhaps there is some
> configuration I'm missing.  Right now we log ship from the active Sql Server
> database to the passive Sql Server database.  During maintenance it would be
> nice to fail to the passive database without impacting the ActiveMQ broker
> and requiring a restart.  When I tested I just stopped the sql server
> windows service and the active ActiveMQ broker shut down requiring a manual
> startup.
> Current JDBC master/slave configuration snippets:
> <persistenceAdapter>
>  <jdbcPersistenceAdapter dataSource="#mssql-ds"/>
> </persistenceAdapter>
> ...
> <bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>  <property name="driverClassName"
> value=""/>
>  <property name="url"
> value="jdbc:sqlserver://;databaseName=activedb;user=sa;password=pa$$word"/>
>  <property name="username" value="activemq"/>
>  <property name="password" value="pa$$word"/>
> </bean>

This is commonly the job of the connection pooler that you're using. A
good connection pooler will test the connections when they're handed
out from the pool to make sure that they're still in good shape.

I know that c3p0 ( handles this via the
c3p0.testConnectionOnCheckout attribute in its configuration. There
are other connection poolers that handle this as well including the
new Tomcat JDBC pooler
which is a rewrite of Commons DBCP (because DBCP is horribly
unmaintained and broken).

perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"

Apache ActiveMQ -
Apache Camel -
Apache ServiceMix -


View raw message