You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Moritz Gmelin <mo...@gmx.de> on 2008/10/03 13:35:41 UTC
Recover broken database connection
Hi
We have a t5 application running using tapestry-hibernate to connect
to a sqlserver database.
Now the applicationserver (tomcat) and the db Server are separated by
ad Firewall that sometimes closes the connection for no reason. This
totally Breaks the t5 application with nothing but ad restart of
tomcat to help.
Is there anything that can be done to handle such a connection
breakdown either in configuration or in Code?
Thanks
Moritz
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org
Re: Recover broken database connection
Posted by Moritz Gmelin <mo...@gmx.de>.
Hi,
thanks. This is exactly what I was looking for.
Just to note (since it is not mentioned in most sources), I had to
also add the following line to my hibernate.cfg.xml to make it work
<property
name
=
"connection
.provider_class">org.hibernate.connection.C3P0ConnectionProvider</
property>
One question remains: Why is this not the default with hibernate?
Regards
Moritz
Am 03.10.2008 um 13:51 schrieb Kristian Marinkovic:
> Hi Moritz,
>
> have you configured a connection provider/pool?
>
> if not hibernate will use its default connection provider that
> is not intended for production use because it uses only one
> connection without guarantee that it is/stays open.
>
> take a look at c3p0 ... it's a matter of 4-5 lines of config values
> to configure a connection pool that will keep the connection
> open in hibernate
>
> g,
> kris
>
>
>
>
>
> Moritz Gmelin <mo...@gmx.de>
> 03.10.2008 13:35
> Bitte antworten an
> "Tapestry users" <us...@tapestry.apache.org>
>
>
> An
> "users@tapestry.apache.org" <us...@tapestry.apache.org>
> Kopie
>
> Thema
> Recover broken database connection
>
>
>
>
>
>
>
> Hi
>
> We have a t5 application running using tapestry-hibernate to connect
> to a sqlserver database.
> Now the applicationserver (tomcat) and the db Server are separated by
> ad Firewall that sometimes closes the connection for no reason. This
> totally Breaks the t5 application with nothing but ad restart of
> tomcat to help.
> Is there anything that can be done to handle such a connection
> breakdown either in configuration or in Code?
>
> Thanks
>
> Moritz
>
> ---------------------------------------------------------------------
> 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: Recover broken database connection
Posted by Kristian Marinkovic <kr...@porsche.co.at>.
Hi Moritz,
have you configured a connection provider/pool?
if not hibernate will use its default connection provider that
is not intended for production use because it uses only one
connection without guarantee that it is/stays open.
take a look at c3p0 ... it's a matter of 4-5 lines of config values
to configure a connection pool that will keep the connection
open in hibernate
g,
kris
Moritz Gmelin <mo...@gmx.de>
03.10.2008 13:35
Bitte antworten an
"Tapestry users" <us...@tapestry.apache.org>
An
"users@tapestry.apache.org" <us...@tapestry.apache.org>
Kopie
Thema
Recover broken database connection
Hi
We have a t5 application running using tapestry-hibernate to connect
to a sqlserver database.
Now the applicationserver (tomcat) and the db Server are separated by
ad Firewall that sometimes closes the connection for no reason. This
totally Breaks the t5 application with nothing but ad restart of
tomcat to help.
Is there anything that can be done to handle such a connection
breakdown either in configuration or in Code?
Thanks
Moritz
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org