I agree with Ryan that setting the connection.provider_class using
Hibernate 3 turns on C3P0.
However, I kept getting the broken pipe problem but this turned out to
be due to an error closing the EntityManagerFactory - I've not yet
worked out if this is my own programming error or if the bug referred to
in the link below is not actually fixed as stated:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2694
Additionally, I thought I'd mention this quickly as it doesn't seem to
be referenced in many other places, I've found that referencing C3P0
(and other properties) in peristence.xml (rather than hibernate.cfg.xml)
requires properties in the form of:
<property name="xxx" value="yyy"/>
Rather than:
<property name="xxx">yyy</property>
Also it doesn't seem to matter (as I believe previously stated) whether
you put "hibernate." in front of the C3P0 properties.
Hope this is of benefit to someone.
Steve |