You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by abangkis <ab...@gmail.com> on 2009/01/10 23:42:03 UTC

Connection Problem

Hello,

I have an application that deployed with this kind of architecture :

Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate -> Mysql.

And every 8 Hour or So, i've got a broken pipe error message.

I've tried following this guide
http://www.codefin.net/2007/05/hibernate-and-mysql-connection-timeouts.html,
but it didn't seems to work. Any other idea what kind of configuration
i should tweak in order for this not to happened ?

the software versions are :

Apache 2.2.8
Sun Java System Application Server 9.1 (build b58g-fcs)
Tapestry 5.0.15
Mysql  5.0.51a-3ubuntu5.4

Cheers ,

Abangkis

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Connection Problem

Posted by abangkis <ab...@gmail.com>.
Hi jonathan,

in the link that I've given. I tried setting up c3po (hibernate
connection pool) idle_test_period and timeout. But it didn't seem to
take an effect. I was following one of the tutorial, and i notice my
META-INF doesn't contain persistence.xml could this have an effect ?
The connection seem to be fine though if its under 8 hour or so.

cheers,

abangkis


On Sun, Jan 11, 2009 at 6:15 AM, Jonathan Barker
<jo...@gmail.com> wrote:
>
> It sounds like you need to configure your connection pool to issue check
> statements before returning a connection (new or existing).
>
>
>> -----Original Message-----
>> From: abangkis [mailto:abangkis@gmail.com]
>> Sent: Saturday, January 10, 2009 17:42
>> To: Tapestry users
>> Subject: Connection Problem
>>
>> Hello,
>>
>> I have an application that deployed with this kind of architecture :
>>
>> Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
>> Mysql.
>>
>> And every 8 Hour or So, i've got a broken pipe error message.
>>
>> I've tried following this guide
>> http://www.codefin.net/2007/05/hibernate-and-mysql-connection-
>> timeouts.html,
>> but it didn't seems to work. Any other idea what kind of configuration
>> i should tweak in order for this not to happened ?
>>
>> the software versions are :
>>
>> Apache 2.2.8
>> Sun Java System Application Server 9.1 (build b58g-fcs)
>> Tapestry 5.0.15
>> Mysql  5.0.51a-3ubuntu5.4
>>
>> Cheers ,
>>
>> Abangkis
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Connection Problem

Posted by Jonathan Barker <jo...@gmail.com>.
It sounds like you need to configure your connection pool to issue check
statements before returning a connection (new or existing).


> -----Original Message-----
> From: abangkis [mailto:abangkis@gmail.com]
> Sent: Saturday, January 10, 2009 17:42
> To: Tapestry users
> Subject: Connection Problem
> 
> Hello,
> 
> I have an application that deployed with this kind of architecture :
> 
> Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
> Mysql.
> 
> And every 8 Hour or So, i've got a broken pipe error message.
> 
> I've tried following this guide
> http://www.codefin.net/2007/05/hibernate-and-mysql-connection-
> timeouts.html,
> but it didn't seems to work. Any other idea what kind of configuration
> i should tweak in order for this not to happened ?
> 
> the software versions are :
> 
> Apache 2.2.8
> Sun Java System Application Server 9.1 (build b58g-fcs)
> Tapestry 5.0.15
> Mysql  5.0.51a-3ubuntu5.4
> 
> Cheers ,
> 
> Abangkis
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Connection Problem

Posted by abangkis <ab...@gmail.com>.
Hi guys, just want to give an update. My problem has been solved, i've
been leaving it for days and there's no connection problem.

in my case, the problem was I'm missing this one line :

<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>

and the real c3p0-0.9.1.jar file. Since in development , using
hibernate-c3p0-3.3.1.GA.jar is enough.

Hope this can help anyone with the same problem.

cheers,

abangkis.

On Mon, Jan 12, 2009 at 10:26 PM, abangkis <ab...@gmail.com> wrote:
> Hi jonathan and angelo, thanks for the pointer. I'll try it this evening.
>
>
> On Mon, Jan 12, 2009 at 10:51 AM, Jonathan Barker
> <jo...@gmail.com> wrote:
>> I configure connection pooling on my app server, so I have no hands-on
>> experience with c3p0.
>>
>> Certainly it looks like this would work well.  If it doesn't, then one more
>> paranoid thing Abangkis can do is add hibernate.c3p0.validate=true to force
>> checking of every connection on checkout from the pool.
>>
>>
>>
>>> -----Original Message-----
>>> From: Angelo Chen [mailto:angelochen960@yahoo.com.hk]
>>> Sent: Sunday, January 11, 2009 22:10
>>> To: users@tapestry.apache.org
>>> Subject: Re: Connection Problem
>>>
>>>
>>> Hi,
>>>
>>> there was a post before in this forum that solves this problem for me, but
>>> I
>>> can't remember the link, basically, here are the things I added and it's
>>> running with any problem:
>>>
>>>   <!-- pool via c3p0 which knows how to reconnect to server and does it
>>> nicely-->
>>>     <property
>>> name="connection.provider_class">org.hibernate.connection.C3P0ConnectionPr
>>> ovider</property>
>>>     <property name="hibernate.c3p0.acquire_increment">3</property>
>>>     <property name="hibernate.c3p0.idle_test_period">100</property>
>>>     <!-- seconds -->
>>>     <property name="hibernate.c3p0.max_size">20</property>
>>>     <property name="hibernate.c3p0.max_statements">0</property>
>>>     <property name="hibernate.c3p0.min_size">1</property>
>>>     <property name="hibernate.c3p0.timeout">1000</property>
>>>
>>> I put this in hibernate.cfg.xml, that's the only file I have for
>>> tapestry-hibernate.
>>>
>>> Angelo
>>>
>>>
>>>
>>> abangkis wrote:
>>> >
>>> > Hello,
>>> >
>>> > I have an application that deployed with this kind of architecture :
>>> >
>>> > Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
>>> > Mysql.
>>> >
>>> > And every 8 Hour or So, i've got a broken pipe error message.
>>> >
>>> > I've tried following this guide
>>> > http://www.codefin.net/2007/05/hibernate-and-mysql-connection-
>>> timeouts.html,
>>> > but it didn't seems to work. Any other idea what kind of configuration
>>> > i should tweak in order for this not to happened ?
>>> >
>>> > the software versions are :
>>> >
>>> > Apache 2.2.8
>>> > Sun Java System Application Server 9.1 (build b58g-fcs)
>>> > Tapestry 5.0.15
>>> > Mysql  5.0.51a-3ubuntu5.4
>>> >
>>> > Cheers ,
>>> >
>>> > Abangkis
>>> >
>>> > ---------------------------------------------------------------------
>>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> > For additional commands, e-mail: users-help@tapestry.apache.org
>>> >
>>> >
>>> >
>>>
>>> --
>>> View this message in context: http://www.nabble.com/Connection-Problem-
>>> tp21393799p21407688.html
>>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Connection Problem

Posted by abangkis <ab...@gmail.com>.
Hi jonathan and angelo, thanks for the pointer. I'll try it this evening.


On Mon, Jan 12, 2009 at 10:51 AM, Jonathan Barker
<jo...@gmail.com> wrote:
> I configure connection pooling on my app server, so I have no hands-on
> experience with c3p0.
>
> Certainly it looks like this would work well.  If it doesn't, then one more
> paranoid thing Abangkis can do is add hibernate.c3p0.validate=true to force
> checking of every connection on checkout from the pool.
>
>
>
>> -----Original Message-----
>> From: Angelo Chen [mailto:angelochen960@yahoo.com.hk]
>> Sent: Sunday, January 11, 2009 22:10
>> To: users@tapestry.apache.org
>> Subject: Re: Connection Problem
>>
>>
>> Hi,
>>
>> there was a post before in this forum that solves this problem for me, but
>> I
>> can't remember the link, basically, here are the things I added and it's
>> running with any problem:
>>
>>   <!-- pool via c3p0 which knows how to reconnect to server and does it
>> nicely-->
>>     <property
>> name="connection.provider_class">org.hibernate.connection.C3P0ConnectionPr
>> ovider</property>
>>     <property name="hibernate.c3p0.acquire_increment">3</property>
>>     <property name="hibernate.c3p0.idle_test_period">100</property>
>>     <!-- seconds -->
>>     <property name="hibernate.c3p0.max_size">20</property>
>>     <property name="hibernate.c3p0.max_statements">0</property>
>>     <property name="hibernate.c3p0.min_size">1</property>
>>     <property name="hibernate.c3p0.timeout">1000</property>
>>
>> I put this in hibernate.cfg.xml, that's the only file I have for
>> tapestry-hibernate.
>>
>> Angelo
>>
>>
>>
>> abangkis wrote:
>> >
>> > Hello,
>> >
>> > I have an application that deployed with this kind of architecture :
>> >
>> > Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
>> > Mysql.
>> >
>> > And every 8 Hour or So, i've got a broken pipe error message.
>> >
>> > I've tried following this guide
>> > http://www.codefin.net/2007/05/hibernate-and-mysql-connection-
>> timeouts.html,
>> > but it didn't seems to work. Any other idea what kind of configuration
>> > i should tweak in order for this not to happened ?
>> >
>> > the software versions are :
>> >
>> > Apache 2.2.8
>> > Sun Java System Application Server 9.1 (build b58g-fcs)
>> > Tapestry 5.0.15
>> > Mysql  5.0.51a-3ubuntu5.4
>> >
>> > Cheers ,
>> >
>> > Abangkis
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> > For additional commands, e-mail: users-help@tapestry.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context: http://www.nabble.com/Connection-Problem-
>> tp21393799p21407688.html
>> Sent from the Tapestry - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
>> For additional commands, e-mail: users-help@tapestry.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


RE: Connection Problem

Posted by Jonathan Barker <jo...@gmail.com>.
I configure connection pooling on my app server, so I have no hands-on
experience with c3p0.  

Certainly it looks like this would work well.  If it doesn't, then one more
paranoid thing Abangkis can do is add hibernate.c3p0.validate=true to force
checking of every connection on checkout from the pool.



> -----Original Message-----
> From: Angelo Chen [mailto:angelochen960@yahoo.com.hk]
> Sent: Sunday, January 11, 2009 22:10
> To: users@tapestry.apache.org
> Subject: Re: Connection Problem
> 
> 
> Hi,
> 
> there was a post before in this forum that solves this problem for me, but
> I
> can't remember the link, basically, here are the things I added and it's
> running with any problem:
> 
>   <!-- pool via c3p0 which knows how to reconnect to server and does it
> nicely-->
>     <property
> name="connection.provider_class">org.hibernate.connection.C3P0ConnectionPr
> ovider</property>
>     <property name="hibernate.c3p0.acquire_increment">3</property>
>     <property name="hibernate.c3p0.idle_test_period">100</property>
>     <!-- seconds -->
>     <property name="hibernate.c3p0.max_size">20</property>
>     <property name="hibernate.c3p0.max_statements">0</property>
>     <property name="hibernate.c3p0.min_size">1</property>
>     <property name="hibernate.c3p0.timeout">1000</property>
> 
> I put this in hibernate.cfg.xml, that's the only file I have for
> tapestry-hibernate.
> 
> Angelo
> 
> 
> 
> abangkis wrote:
> >
> > Hello,
> >
> > I have an application that deployed with this kind of architecture :
> >
> > Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
> > Mysql.
> >
> > And every 8 Hour or So, i've got a broken pipe error message.
> >
> > I've tried following this guide
> > http://www.codefin.net/2007/05/hibernate-and-mysql-connection-
> timeouts.html,
> > but it didn't seems to work. Any other idea what kind of configuration
> > i should tweak in order for this not to happened ?
> >
> > the software versions are :
> >
> > Apache 2.2.8
> > Sun Java System Application Server 9.1 (build b58g-fcs)
> > Tapestry 5.0.15
> > Mysql  5.0.51a-3ubuntu5.4
> >
> > Cheers ,
> >
> > Abangkis
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: users-help@tapestry.apache.org
> >
> >
> >
> 
> --
> View this message in context: http://www.nabble.com/Connection-Problem-
> tp21393799p21407688.html
> Sent from the Tapestry - User mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Connection Problem

Posted by Angelo Chen <an...@yahoo.com.hk>.
Hi,

there was a post before in this forum that solves this problem for me, but I
can't remember the link, basically, here are the things I added and it's
running with any problem:

  <!-- pool via c3p0 which knows how to reconnect to server and does it
nicely-->
    <property
name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
    <property name="hibernate.c3p0.acquire_increment">3</property>
    <property name="hibernate.c3p0.idle_test_period">100</property>
    <!-- seconds -->
    <property name="hibernate.c3p0.max_size">20</property>
    <property name="hibernate.c3p0.max_statements">0</property>
    <property name="hibernate.c3p0.min_size">1</property>
    <property name="hibernate.c3p0.timeout">1000</property>

I put this in hibernate.cfg.xml, that's the only file I have for
tapestry-hibernate.

Angelo



abangkis wrote:
> 
> Hello,
> 
> I have an application that deployed with this kind of architecture :
> 
> Apache httpd server -> Glassfishv2 -> Tapestry -> Tapestry-Hibernate ->
> Mysql.
> 
> And every 8 Hour or So, i've got a broken pipe error message.
> 
> I've tried following this guide
> http://www.codefin.net/2007/05/hibernate-and-mysql-connection-timeouts.html,
> but it didn't seems to work. Any other idea what kind of configuration
> i should tweak in order for this not to happened ?
> 
> the software versions are :
> 
> Apache 2.2.8
> Sun Java System Application Server 9.1 (build b58g-fcs)
> Tapestry 5.0.15
> Mysql  5.0.51a-3ubuntu5.4
> 
> Cheers ,
> 
> Abangkis
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Connection-Problem-tp21393799p21407688.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org