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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate , Tomcat & JBossCache
PostPosted: Mon Nov 14, 2005 10:58 am 
Newbie

Joined: Mon Nov 14, 2005 10:20 am
Posts: 2
Since days
I`m trying to configure a CacheProvider, e.g. JBossCache
I have tried allmost all differnent types of entries which are listed int the world wide web, but Hibernate still does load it's default CacheProvider EHCacheprovider and ignores the other. I also tried to set different paths of the class JBossCacheProviders.
Does anyone have a solution to this problem?
I am using Hibernate 3.0,Spring Framwork (2.1) and Tomcat 5.0
under XP

Greetings

ola

The following are the settings in the Hibernate Property files.

hibernate.provider file:
# [..]

hibernate.cache.provider_class=net.sf.cache.TreeCacheProvider

[..]

#------------------------------------------------------------

the hibernate.cfg.xml:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>


<session-factory>

[..]

<property name="dialect">net.sf.hibernate.dialect.GenericDialect</property>
<property name="hibernate.cache.provider_class">org.jboss.cache.TreeCacheProvider</property>

[..]

</session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 11:47 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
Debug: SettingsFactory.createCacheProvider(Properties p).

Or if you use it with Spring set it here:
Code:
    <!-- Hibernate SessionFactory -->
    <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="useTransactionAwareDataSource"><value>false</value></property>
        <property name="dataSource"><ref local="dataSource"/></property>
        <property name="mappingDirectoryLocations">
           <list>
              <value>classpath:/com</value>
           </list>
       </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.connection.release_mode">${hibernate.connection.release_mode}</prop>
                <prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
                <prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
                <prop key="hibernate.query.substitutions">${hibernate.query.substitutions}</prop>
                <prop key="hibernate.jdbc.use_scrollable_resultset">${hibernate.jdbc.use_scrollable_resultset}</prop>
                <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
                <prop key="hibernate.jdbc.batch_versioned_data">${hibernate.jdbc.batch_versioned_data}</prop>
                <prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
            </props>
        </property>
    </bean>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 15, 2005 8:08 am 
Newbie

Joined: Mon Nov 14, 2005 10:20 am
Posts: 2
[quote="alesj"]Debug: SettingsFactory.createCacheProvider(Properties p).

Or if you use it with Spring set it here:
[code]
<!-- Hibernate SessionFactory -->
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="useTransactionAwareDataSource"><value>false</value></property>
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingDirectoryLocations">
<list>
<value>classpath:/com</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.connection.release_mode">${hibernate.connection.release_mode}</prop>
<prop key="hibernate.cache.provider_class">${hibernate.cache.provider_class}</prop>
<prop key="hibernate.cache.use_query_cache">${hibernate.cache.use_query_cache}</prop>
<prop key="hibernate.query.substitutions">${hibernate.query.substitutions}</prop>
<prop key="hibernate.jdbc.use_scrollable_resultset">${hibernate.jdbc.use_scrollable_resultset}</prop>
<prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>
<prop key="hibernate.jdbc.batch_versioned_data">${hibernate.jdbc.batch_versioned_data}</prop>
<prop key="hibernate.generate_statistics">${hibernate.generate_statistics}</prop>
</props>
</property>
</bean>
[/code][/quote]


Thank you very much was a great help!
ola


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.