-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: MySQL connection expires
PostPosted: Mon May 09, 2011 12:44 pm 
Newbie

Joined: Thu May 05, 2011 3:31 am
Posts: 8
I tried c3p0 but .. I couldn't find any solution so I tried DBCP
right now my settings look like this :
Code:
   <bean id="amsacDS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
      <property name="driverClassName">
         <value>com.mysql.jdbc.Driver</value>
      </property>
      <property name="url">
         <value>jdbc:mysql://localhost:3306/asda_asd</value>
      </property>
      <property name="username">
         <value>assdfssad</value>
      </property>
      <property name="password">
         <value>dfsfd</value>
         
      </property>

      <property name="maxIdle">
         <value>8</value>
      </property>
      <property name="maxActive">
         <value>20</value>
      </property>
      <property name="initialSize">
         <value>5</value>
      </property>
    
      <property name="validationQuery">
         <value>select 1</value>
      </property>
      <property name="testOnBorrow">
         <value>true</value>
      </property>
      <property name="timeBetweenEvictionRunsMillis">
         <value>600000</value>
      </property>
      <property name="testWhileIdle">
         <value>true</value>
      </property>

      <property name="removeAbandoned">
         <value>true</value>
      </property>
         <property name="logAbandoned">
         <value>true</value>
      </property>
         <property name="removeAbandonedTimeout">
         <value>100</value>
      </property>
    
   </bean>


when a connection goes stale this configuration has a validate query
which must validate a connection before handing it over to app ... ...
but in my case when MySQL drops conection .. the Data source returns the stale conection without Validating it...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 16 posts ]  Go to page Previous  1, 2

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.