activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From magellings <mark.gelli...@qg.com>
Subject Re: Is there JDBC master/slave retry logic if database goes down?
Date Tue, 10 Mar 2009 22:40:30 GMT

Thanks for the response Bruce.  :)

To my knowledge we aren't using a connection pooler.  We're just configuring
the activemq xml and letting activeMQ do its thing.  One of my colleagues
mentioned SNAC since we are using Sql Server, not sure if that is similar to
a connection pooler or not.  

In our scenario during a Sql Server failover it may take 15 minutes.  We
aren't using a high availability cluster.  Does a connection pooler give the
capability of dealing with this so that ActiveMQ doesn't shutdown?


bsnyder wrote:
> 
> On Tue, Mar 10, 2009 at 12:15 PM, magellings <mark.gellings@qg.com> 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="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>>  <property name="url"
>> value="jdbc:sqlserver://QG076619.qg.com:1433;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 (http://c3p0.sf.net/) 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
> (http://tomcat.apache.org/dev/dist/jdbc-pool/1.0-beta/v1.0.15-beta/)
> which is a rewrite of Commons DBCP (because DBCP is horribly
> unmaintained and broken).
> 
> Bruce
> -- 
> perl -e 'print
> unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
> );'
> 
> Apache ActiveMQ - http://activemq.apache.org/
> Apache Camel - http://camel.apache.org/
> Apache ServiceMix - http://servicemix.apache.org/
> 
> Blog: http://bruceblog.org/
> 
> 

-- 
View this message in context: http://www.nabble.com/Is-there-JDBC-master-slave-retry-logic-if-database-goes-down--tp22440338p22445136.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message