-->
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: cacheing, cachemode, & overriding read-only config
PostPosted: Wed Oct 17, 2007 5:27 pm 
Newbie

Joined: Wed Jun 27, 2007 3:32 pm
Posts: 3
I have a web application that has a bunch of entities that are read-only. For example:

Code:
<property name="entityCacheStrategies">
            <props>
              <prop key="com.me.myobject">read-only</prop>
...


The exception to this "read-onlyness" is a nightly batch update. But, when I try to run my batch update program, I get exceptions from the ReadOnlyCache (ehCache):

Code:
ERROR org.hibernate.cache.ReadOnlyCache - Application attempted to edit read only item:
java.lang.UnsupportedOperationException: Can't write to a readonly object

To try to fix this, I am now doing this during my batch update:
Code:
session.setCacheMode(CacheMode.IGNORE);


But, to no avail. I continue to receive the same exceptions from ReadOnlyCache. It seems like the CacheMode.IGNORE directive is being, uh, ignored.

I can work around this by setting the cache strategy to read-write, but that is not my preferred long-term solution.

I noticed an issue in jira (HHH-2661) that seems to be related, but I can't tell if it's been confirmed, denied, etc. Anyone have any thoughts on this?

FYI, I'm using hibernate 3.2.5ga


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.