Dave Tilley wrote:

I've been having trouble getting Connection Pooling working with either
C3P0 or DBCP and using MySQL... the connection dies after some number of
hours and the next time the webapp is used, it hangs, and an ioException
is logged with a connection failure.


I have been told there is some type of 'connection validation' that is
configurable and now i have learned that it is required in order to make
pooled connections work and not fail when the db/driver times out.

Can someone please explain *exactly* which hibernate.cfg.xml parameters
need to be set (and to what values) to get pooling working and exactly
how one sets up this 'Connection Validation' that i have heard about??
FYI: I'm using Hibernate 2 and MySQL 4 and (trying) C3P0.

I'm sorry if this is an old/tired question to some, but combing the
mailing lists, i see a variety of answers that do not seem clear to me
and i can find no information on the website regarding Connection
Validation.  Can someone please give a redux on how to do all this 'the
right way'???


The parameter in DBCP is "validationQuery" which you need to set to something (anything - it's just used to test if the connection is still alive). Somethinglike "select 1 from dual" works well if you're using Oracle.


Don't know about C3PO, and I can't give you the exact config for hibernate.cfg either since I access DBCP as a JNDI resource.


-Mark






-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel

Reply via email to