OK, Thiago! :))
Just for the final, I have managed to solve this by following:
My host operator had global wait_timeout set to around 60 secs, and since I 
didn't have local wait_timeout( the one set for my app( just append it to jdbc 
string ) ) it operated on global wait_timeout, and would throw cannot open 
connection after that interval, since my c3p0 settings were setup so high, and 
couldn't manage between.


so solution for this would have been:
c3p0 idle time around 300 ( less than wait timeout and c3p0 timeout )
c3p0 timeout 2400 ( less than wait_timeout, but higher than idle time )
wait_timeout( could be appended to jdbc as a string, and must be higher than 
c3p0 timeout and idle time )

If these formulations above should be applied, issue is gone.

> To: users@tapestry.apache.org
> Subject: Re: Issue with cannot open connection
> Date: Sat, 10 Aug 2013 17:27:07 -0300
> From: thiag...@gmail.com
> 
> Guys, please don't continue this thread. This is a pure MySQL problem,  
> completely unrelated to Tapestry. Thank you. ;)
> 
> On Sat, 10 Aug 2013 15:54:14 -0300, Dmitry Gusev <dmitry.gu...@gmail.com>  
> wrote:
> 
> > It may be that connection that is in the pool is stil open, but database
> > already closed it by timeout. You need to chek timeouts in the pool so  
> > that
> > it be less than in the database.
> >
> > On Saturday, August 10, 2013, Nomen Nominus wrote:
> >
> >> Here is my problem. I have a very classical configuration where a webapp
> >>
> >> with some Hibernate code in it accesses a MySQL DB. Everything is
> >>
> >> installed in Tomcat 6.
> >> I even acquired c3p0 connection pooling with the following  
> >> configuration:
> >>
> >> <?xml version="1.0" encoding="UTF-8"?>
> >>
> >> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate
> >> Configuration DTD//EN"
> >>    "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd";>
> >> <hibernate-configuration>
> >>
> >> <session-factory>
> >>
> >>     <!-- Settings for MySql DB -->
> >>
> >>     <property
> >> name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
> >>
> >>     <property
> >> name="hibernate.connection.url">jdbc:mysql://localhost:3306/myDB?autoReconnect=true</property>
> >>     <property name="hibernate.connection.username">myUsername</property>
> >>
> >>     <property name="hibernate.connection.password">myPass</property>
> >>
> >>     <property
> >> name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
> >>     <property  
> >> name="dialect">org.hibernate.dialect.MySQLDialect</property>
> >>     <property name="hibernate.connection.pool_size">5</property>
> >>     <property name="show_sql">true</property>
> >>
> >>     <property name="hibernate.c3p0.idle_test_period">1800</property>  
> >> <!--
> >> In seconds -->
> >>
> >>     <property name="hibernate.c3p0.min_size">5</property>
> >>
> >>     <property name="hibernate.c3p0.max_size">20</property>
> >>
> >>     <property name="hibernate.c3p0.timeout">2400</property>
> >>     <property name="hibernate.c3p0.max_statements">50</property>
> >>
> >> </session-factory>
> >>
> >> </hibernate-configuration>
> >>
> >> After some time, ( around 60 secs ) Hibernate complains about dropped
> >> connections, the
> >>
> >> error message looks like this :
> >>
> >> com.mysql.jdbc.CommunicationsException : Communications link failure The
> >>
> >> last packet successfully received from the server was
> >> milliseconds ago. The last packet sent successfully to the server was 0
> >>
> >> milliseconds ago.
> >>
> >> java.io.EOFException : Can not read response from server. Expected to
> >>
> >> read 4 bytes, read 0 bytes before connection was unexpectedly lost.
> >>
> >>
> >> Refeshing the page once or twice usually fixes the problem.
> >>
> >>
> >> Has anyone else encountered on this issue before, and if so, please help
> >> me. What could be possible solution to this resolution?
> >>
> >> Thanks in advance.
> >>
> >>
> >>
> >
> >
> >
> 
> 
> -- 
> Thiago H. de Paula Figueiredo
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
> For additional commands, e-mail: users-h...@tapestry.apache.org
> 
                                          

Reply via email to