ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From NickSTL <NBe...@express-scripts.com>
Subject Re: check if a connection is valid in IBatis
Date Fri, 06 Nov 2009 15:40:51 GMT

The ping options can be set in the config XML like so.  The Pool.* options
are what you need.  This is just an example, you should set whatever timeout
parameters you need (in ms).

<transactionManager type="JDBC">
		<dataSource type="SIMPLE">
			<property name="JDBC.Driver" value="${driver}"/>
			<property name="JDBC.ConnectionURL" value="${url}"/>
			<property name="JDBC.Username" value="${user}"/>
			<property name="JDBC.Password" value="${password}"/>
			<property name="Pool.TimeToWait" value="2000"/>
           	                          <property name="Pool.PingQuery"
value="SELECT 1"/>
                          	<property name="Pool.PingEnabled" value="true"/>
name="Pool.PingConnectionsOlderThan" value="600000"/>
			<property name="Pool.PingConnectionsNotUsedFor" value="600000"/> 

Hopefully this helps you!  Take a look at the javadoc for
com.ibatis.common.jdbc.SimpleDataSource for the rull list of pool options.

View this message in context: http://old.nabble.com/check-if-a-connection-is-valid-in-IBatis-tp26217372p26230808.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message