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: Caching Problems --> Weird Exception
PostPosted: Wed Jun 01, 2005 3:27 am 
Newbie

Joined: Thu May 12, 2005 5:39 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1

Mapping documents: tempclass.xml
<class name="tempclass" table="field_option_value" batch-size="10">
<composite-id name="comp_id" class="tempclassPK">
<key-property name="id" column="option_id" type="int"/>
<key-property name="value" column="value_txt" type="string"/>
</composite-id>
<property name="displayOrderNum" type="java.lang.Integer" column="display_order_num" />
<property name="description" type="string" column="value_desc" not-null="true" length="100"/>
<many-to-one name="listName" class="tempColl" column="option_id" insert="false" update="false"/>
</class>


added
<property name="hibernate.cache.provider_class">net.sf.hibernate.cache.OSCacheProvider</property>
<property name="hibernate.cache.use_query_cache">true</property> in config file.


Code between sessionFactory.openSession() and session.close():

Code:
Query query = getSession().createQuery("from tempclass as item " + "where item.listName.name = :listName order by item.displayOrderNum");
query.setCacheable(true);
query.setString("listName", listName);
items = query.list();


Full stack trace of any exception that occurs:
Code:
net/sf/hibernate/cache/ReadWriteCache$Item incompatible with net/sf/hibernate/impl/CacheEntry
   at java.lang.Throwable.<init>(Throwable.java)
   at java.lang.Throwable.<init>(Throwable.java)
The cause for this exception is ClassCastException


[/code]


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.