-->
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.  [ 1 post ] 
Author Message
 Post subject: Can't make JBossCache work with hibernate under Spring
PostPosted: Thu Oct 28, 2004 12:50 pm 
Newbie

Joined: Thu Oct 28, 2004 11:50 am
Posts: 1
I would like to config the sample app petclinic from Springframework which use hibernate. It's working without problem but when I want to try 2nd Level cache using JBossCache, I found that hsql is always generated, which is not expected if it's already cache up for configured classes. And I found that the temp objects are created by JBossCache. Is there anyway to verify which part I done wrong? Thanks.

Hibernate version:
2.1
Mapping documents:

<hibernate-mapping auto-import="true">

<class name="org.springframework.samples.petclinic.Vet" table="vets">
<cache usage="read-only"/>

<id name="id" column="id" unsaved-value="-1">
<generator class="identity"/>
</id>
<property name="firstName" column="first_name"/>
<property name="lastName" column="last_name"/>
<set name="specialtiesInternal" table="vet_specialties">
<key column="vet_id"/>
<many-to-many column="specialty_id" class="org.springframework.samples.petclinic.Specialty"/>
</set>
</class>

Code between sessionFactory.openSession() and session.close():
<bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="mappingResources">
<value>petclinic.hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">${hibernate.dialect}</prop>
<prop key="hibernate.show_sql">true</prop>
<prop key="hibernate.cglib.use_reflection_optimizer">true</prop>
<prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.TreeCacheProvider</prop>
</props>
</property>
</bean>
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
Mysql 4.x
The generated SQL (show_sql=true):
Hibernate: select specialtie0_.vet_id as vet_id__, specialtie0_.specialty_id as
specialt2___, specialty1_.id as id0_, specialty1_.name as name0_ from vet_specia
lties specialtie0_ inner join specialties specialty1_ on specialtie0_.specialty_
id=specialty1_.id where specialtie0_.vet_id=?

Debug level Hibernate log excerpt:


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

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.