Apparently inaccurate 'java.lang.UnsupportedOperationException: Illegal attempt to
edit read only item' when using SQLQuery.executeUpdate
-----------------------------------------------------------------------------------------------------------------------------------------
Key: HHH-6329
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6329
Project: Hibernate Core
Issue Type: Bug
Components: caching (L2), core
Affects Versions: 3.6.5
Environment: Hibernate 3.6.5, PostgreSQL, OpenJDK 7.0.144, FreeBSD 8.2
Reporter: Alex Hayward
The following code (and, indeed, anything similar using INSERT):
SQLQuery createSequence = sess.createSQLQuery("CREATE SEQUENCE printOrder" +
getId());
createSequence.executeUpdate();
results in an attempt to flush the entire L2 cache. This, in turn, results in:
java.lang.UnsupportedOperationException: Illegal attempt to edit read only item
at
org.hibernate.cache.infinispan.entity.ReadOnlyAccess.lockRegion(ReadOnlyAccess.java:28)
at
org.hibernate.action.BulkOperationCleanupAction$EntityCleanup.<init>(BulkOperationCleanupAction.java:205)
at
org.hibernate.action.BulkOperationCleanupAction$EntityCleanup.<init>(BulkOperationCleanupAction.java:199)
at
org.hibernate.action.BulkOperationCleanupAction.<init>(BulkOperationCleanupAction.java:120)
at
org.hibernate.engine.query.NativeSQLQueryPlan.coordinateSharedCacheCleanup(NativeSQLQueryPlan.java:176)
at
org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:189)
at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1310)
at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:396)
at
BoxOffice.BusinessObjects.PrintQueue.createPrintOrderSequence(PrintQueue.java:77)
at BoxOffice.Server.CorbaImpl.PrintManager.addPrintQueue(PrintManager.java:808)
at
BoxOffice.Server.CorbaImpl.PrintManagerImpl.addPrintQueue(PrintManagerImpl.java:938)
at BoxOffice.CORBA.PrintManagerPOATie.addPrintQueue(PrintManagerPOATie.java:78)
at BoxOffice.CORBA.PrintManagerPOA._invoke(PrintManagerPOA.java:198)
at org.jacorb.poa.RequestProcessor.invokeOperation(RequestProcessor.java:301)
at org.jacorb.poa.RequestProcessor.process(RequestProcessor.java:604)
at org.jacorb.poa.RequestProcessor.run(RequestProcessor.java:747)
'persister' on line 120 of BulkOperationCleanupAction is
'SingleTableEntityPersister(BoxOffice.BusinessObjects.Country)' when this happens.
'Country' is a read-only object. None have been modified. Using doWork instead
works, but is unfortunately a rather awkward API for many cases.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira