Hi Anton!

We are running with MySQL Persistence for the repositories, and also use 
Hibernate to store some submitted form-data from the public site.
We have seen no problems so far in production, certainly not regular connection 
problems after 8 hours, like you describe.

Our setup is like this:

* We use JNDI to obtain the DB connections
* We use 2 Connection Pools: one for magnolia/jackrabbit and one for our 
hibernate form stuff
* The connection pools are configured in tomcat, as GlobalNamingResources in 
the server.xml

This setup seems to be working well.

I would not recommend using the same connection pools (or even the same 
database and database users!) for magnolia and for your own stuff. Better keep 
those separate, IMHO, or your hibernate apps might do something nasty to the 
repository data...

Regards from Vienna,

Richard




-----Ursprüngliche Nachricht-----
Von: [email protected] [mailto:[email protected]] 
Im Auftrag von Anton Matheis
Gesendet: Mittwoch, 26. Jänner 2011 13:33
An: Magnolia User-List
Betreff: Re: [magnolia-user] MySQL Persistence


Hi,

we had a problem with Hibernate and MySQL: the database connection gets closed 
after 8 hours when it's idle. So on our dev server, after
8 hours idle, the connection got closed and we got errors with our applications.

So we googled and found that:
http://www.databasesandlife.com/automatic-reconnect-from-hibernate-to-mysql/
which is not 100% true because here
http://stackoverflow.com/questions/3123962/hibernate-and-mysql-timeout-problem-doesnt-work-with-c3p0
they state that you have to implement a custom LocalSessionFactoryBean to get 
c3p0 working because of a spring bug.

We did that and now we don't have the connection problems with our applications 
anymore. But: we get that same error message as you do and now my first guess 
would be that in our case while hibernate is now connected via c3p0, magnolia 
is not and thus the problem now occurs for our magnolia instance (which uses 
MySQL).

tldr: MySQL disconnects after 8 hours idle without usage of c3p0 -> problem for 
magnolia?

Anyone having similar setup/problems?

Greetings,
Anton


----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------





----------------------------------------------------------------
For list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to