You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by AD <st...@gmail.com> on 2008/12/18 20:30:25 UTC

testonborrow for DBCP

Hello,
 Is there a way to enable teh "testonborrow" feature with a mysql datasource
in a standlone ActiveMQ 5.1 deployment?  We are seeing the "mysql
Communication failure" error and would like to enable this feature to
prevent this.

Thanks
Adam

Re: testonborrow for DBCP

Posted by Bruce Snyder <br...@gmail.com>.
On Thu, Dec 18, 2008 at 12:30 PM, AD <st...@gmail.com> wrote:
> Hello,
>  Is there a way to enable teh "testonborrow" feature with a mysql datasource
> in a standlone ActiveMQ 5.1 deployment?  We are seeing the "mysql
> Communication failure" error and would like to enable this feature to
> prevent this.

IIRC, I think that's just a property on the DBCP datasource that wraps
the MySQL datasource, correct? E.g.:

<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
  <property name="driverClassName" value="com.mysql.jdbc.Driver" />
  <property name="url"
value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true" />
  <property name="username" value="activemq" />
  <property name="password" value="activemq" />
  <property name="maxActive" value="200" />
  <property name="poolPreparedStatements" value="true" />
  <property name="testOnBorrow" value="true" />
</bean>

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.org/
Apache Camel - http://activemq.org/camel/
Apache ServiceMix - http://servicemix.org/

Blog: http://bruceblog.org/