From: <leg...@at...> - 2003-11-21 22:25:25
|
Message: The following issue has been closed. Resolver: Gavin King Date: Fri, 21 Nov 2003 4:25 PM OK, I've squashed the second exception. --------------------------------------------------------------------- View the issue: http://opensource.atlassian.com/projects/hibernate/secure/ViewIssue.jspa?key=HB-488 Here is an overview of the issue: --------------------------------------------------------------------- Key: HB-488 Summary: rollback fails on read-only cache Type: Bug Status: Closed Priority: Major Resolution: FIXED Project: Hibernate2 Components: core Fix Fors: 2.1 rc1 Versions: 2.1 beta 6 Assignee: Gavin King Reporter: Loren Rosen Created: Fri, 21 Nov 2003 2:05 PM Updated: Fri, 21 Nov 2003 4:25 PM Environment: Mac OSX 10.1.5 JDK 1.3.1 Description: I'm getting the message "AssertionFailure - -An AssertionFailure occured - this may indicate a bug in Hibernate". Here's the situation: I have a class with read-only caching (<cache usage="read-only"/>. But I do not have mutable="false" for this class-- perhaps that doesn't make sense, but I thought I should at least report the problem I stumbled on while trying to run this setup, before I change my configuration. First, I create a new object (via new.... Session.save.... Transaction.commit). This does do the database insert (which perhaps it shouldn't do in this configuration). Next, in a new session with a new transaction, I take the same object, and delete it (via Session.delete.... Transaction.commit). This gets an exception on the commit, "java.lang.UnsupportedOperationException: Can't write to a readonly object", which is reasonable. Now the code goes to the exception handler, which naturally attempts to rollback the transaction. This raises another exception, with the "may indicate a bug message" : [DEBUG] JDBCTransaction - -rollback [ERROR] ReadOnlyCache - -Application attempted to edit read only item: 360449 [ERROR] AssertionFailure - -An AssertionFailure occured - this may indicate a bug in Hibernate <java.lang.UnsupportedOperationException: Can't write to a readonly object>java.lang.UnsupportedOperationException: Can't write to a readonly object at net.sf.hibernate.cache.ReadOnlyCache.release(ReadOnlyCache.java:47) at net.sf.hibernate.impl.ScheduledDeletion.afterTransactionCompletion(ScheduledDeletion.java:34) at net.sf.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:530) at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:90) at com.loren.DocumentExample.deleteTestDoc(DocumentExample.java:617) at com.loren.DocumentExample.main(DocumentExample.java:71) Exception in thread "main" net.sf.hibernate.AssertionFailure: Exception releasing cache locks at net.sf.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:541) at net.sf.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:90) at com.loren.DocumentExample.deleteTestDoc(DocumentExample.java:617) at com.loren.DocumentExample.main(DocumentExample.java:71) Caused by: java.lang.UnsupportedOperationException: Can't write to a readonly object at net.sf.hibernate.cache.ReadOnlyCache.release(ReadOnlyCache.java:47) at net.sf.hibernate.impl.ScheduledDeletion.afterTransactionCompletion(ScheduledDeletion.java:34) at net.sf.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:530) ... 3 more --------------------------------------------------------------------- JIRA INFORMATION: 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.jspa If you want more information on JIRA, or have a bug to report see: http://www.atlassian.com/software/jira |