Hi,
I have configured JOTM 1.5.3 for use with Hibernate 2.1.3 and Tomcat 5.0.24. I also use EHCache as a second level cache (Why I need JOTM). I'm a bit confused if I'm using it the way it was intended.
I'm doing the following:
Tomcat 5 configuration
I have created a conf/Catalina/localhost/monster.xml file. This is the way to do "application level server.xml configuration" within TC5.
Code:
<Context path="/monster" docBase="monster"
debug="0" reloadable="true">
<!-- Resource configuration for UserTransaction use JOTM -->
<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>
</Context>
My Hibernate.properties looks like this.
Code:
# Monster - Hibernate properties
hibernate.connection.driver_class=com.mysql.jdbc.Driver
hibernate.connection.url=jdbc:mysql://127.0.0.1:3306/monster
hibernate.connection.username=root
hibernate.connection.password=
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class net.sf.hibernate.transaction.JOTMTransactionManagerLookup
hibernate.c3p0.max_size=10
hibernate.c3p0.min_size=0
hibernate.c3p0.max_statements=10
hibernate.dialect=net.sf.hibernate.dialect.MySQLDialect
hibernate.cache.provider_class=net.sf.ehcache.hibernate.Provider
hibernate.show_sql=false
This all seems to work but it seems a bit strange that Hibernate still manages the JDBC pooling. Shouldn't this be handled by JOTM?!? As I said it all works and the log-entries indicates that all is in order but I just want to be sure that I'm not out on a limb here...
Thanks // Torben Norling