You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Odelya YomTov <od...@jpost.com> on 2009/09/10 13:39:06 UTC

connecting to datebase

Hi!
I have a problem with connection to the database.
I get com.mysql.jdbc.exceptions.jdbc4.CommunicationsException

I connect like this:
<transactionManager type="JDBC">
		<dataSource type="SIMPLE">
			<property value="${driver}" name="JDBC.Driver" />
			<property value="${url}" name="JDBC.ConnectionURL"
/>
			<property value="${username}" name="JDBC.Username"
/>
			<property value="${password}" name="JDBC.Password"
/>
			<property name="defaultAutoCommit" value="true" />
			<property name="defaultTransactionIsolation"
value="2" />
			<property name="maxActive" value="10" />
			<property name="removeAbandoned" value="true" />
			<property name="removeAbandonedTimeout" value="30"
/>
			<property name="logAbandoned" value="false" />
			<property name="validationQuery" value="select 1" />
		</dataSource>
	</transactionManager>

Is there another way to connect to DB (other than SIMPLE) that I can try to
avoid the error?
It happens every 24 hours more or less

Thanks



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


RE: connecting to datebase

Posted by I L <is...@hotmail.com>.
look into mysql autoReconnect

e.g.
<property name="JDBC.ConnectionURL" value="${url}?autoReconnect=true" />

> From: odelya@jpost.com
> To: user-java@ibatis.apache.org
> Subject: connecting to datebase
> Date: Thu, 10 Sep 2009 14:39:06 +0300
> 
> Hi!
> I have a problem with connection to the database.
> I get com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
> 
> I connect like this:
> <transactionManager type="JDBC">
> 		<dataSource type="SIMPLE">
> 			<property value="${driver}" name="JDBC.Driver" />
> 			<property value="${url}" name="JDBC.ConnectionURL"
> />
> 			<property value="${username}" name="JDBC.Username"
> />
> 			<property value="${password}" name="JDBC.Password"
> />
> 			<property name="defaultAutoCommit" value="true" />
> 			<property name="defaultTransactionIsolation"
> value="2" />
> 			<property name="maxActive" value="10" />
> 			<property name="removeAbandoned" value="true" />
> 			<property name="removeAbandonedTimeout" value="30"
> />
> 			<property name="logAbandoned" value="false" />
> 			<property name="validationQuery" value="select 1" />
> 		</dataSource>
> 	</transactionManager>
> 
> Is there another way to connect to DB (other than SIMPLE) that I can try to
> avoid the error?
> It happens every 24 hours more or less
> 
> Thanks
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
> 

_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009