handling hibernate UnsupportedOperationException: Can't write to a readonly object

See if this blog page is useful:

Check that your Hibernate class mapping has mutable="false", which prevents Hibernate from issuing updates for already existing instances. Here is a link to my Hibernate Forums thread about this problem.


For the lazy/stupid people amongst us (like me ;))

changing

@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)

into

@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)

(for example)

(in the database type pojo)

might help too :)

S.

Tags:

Java

Hibernate