• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Hibernate : SecondLevel Cache : Can't write to a readonly object

 
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

We are using EHCACHE as the second level caching mechanism in our Hibernate project. As part of EHCACHE configuration I want to cache certain associations.

Thus in a hbm file I have added

<cache usage="read-only" />

at the class level and also at the association level.

However due to the addition of

<cache usage="read-only" />

at the association it gives me this error :
[i]
Can't write to a readonly object
java.lang.UnsupportedOperationException: Can't write to a readonly object
[/i]

What is the reason for this ? I can make it work if I make it <cache usage="read-write" />. However I want to keep it read-only.

In the hbm file at the class level, I have stated mutable="false". How do I do that for the association ? Adding mutable as an attribute of 'set' does not seem to work (although it should have).Anyways, although I strongly feel that it is due to mutable issue, it maybe due to somthing else. Any ideas / suggestions ?

Thanks and regards,
Milan
 
No prison can hold Chairface Chippendale. And on a totally different topic ... my stuff:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!