-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: JOTM and JDBC Connections
PostPosted: Mon May 31, 2004 11:59 am 
Newbie

Joined: Fri Oct 03, 2003 6:47 am
Posts: 15
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 01, 2004 3:36 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Somehow you have to configure the JOTM datasource to allow it to handle connection into Txs), right now you're using direct JDBC connection access.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.