Can't reassociate immutable proxy to sesssion using LockMode.NONE
-----------------------------------------------------------------
Key: HHH-6031
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-6031
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.6.2
Environment: Hibernate 3.6.2.Final, MySQL
Reporter: Nicolas Estrada
Priority: Critical
Hello,
Occasionally but not always I get a weird exception when I attempt to associate a detached
proxy of an immutable (ie. read only) entity to the persistence context using
LockMode.NONE. I should note that it doesn't always occur but sufficiently that I can
somewhat reproduce it every hundreth or so lock() invocations.
Here is the stack trace:
2011-03-18 02:18:30.703 [TransactionSubscriber] SEVERE
com.eads.impact.appli.impl.mip.oigmgr - Fatal database error
com.eads.impact.base.impl.coredb.hibernate.ProxyDatabaseException: Unable to lock the
object: ObjectType_$$_javassist_29 @40264c[id=29000000000000000001] with lock mode: NONE
at
com.eads.impact.base.impl.coredb.DefaultPersistenceService.lock(DefaultPersistenceService.java:444)
at
com.eads.impact.base.impl.coredb.HibernateDatabaseService.lock(HibernateDatabaseService.java:671)
at
com.eads.impact.appli.impl.mip.oigmgr.gis.ObjectItemGisElement.processObjectItemType(ObjectItemGisElement.java:597)
at
com.eads.impact.appli.impl.mip.oigmgr.gis.ObjectItemGisElement.processObjectItemType(ObjectItemGisElement.java:556)
at
com.eads.impact.appli.impl.mip.oigmgr.ContextLayer.processDynamicPendingContextUpdates(ContextLayer.java:1280)
at
com.eads.impact.appli.impl.mip.oigmgr.OigLayerDatabaseListener.flush(OigLayerDatabaseListener.java:382)
at
com.eads.impact.base.impl.coredb.DatabaseListenerManager.notifyDatabaseListeners(DatabaseListenerManager.java:237)
at
com.eads.impact.base.impl.coredb.cluster.TransactionSubscriber.run(TransactionSubscriber.java:89)
Caused by: org.hibernate.TransientObjectException: Instance was not associated with this
persistence context
at
org.hibernate.engine.StatefulPersistenceContext.isReadOnly(StatefulPersistenceContext.java:1344)
at
org.hibernate.engine.StatefulPersistenceContext.setReadOnly(StatefulPersistenceContext.java:1355)
at
org.hibernate.proxy.AbstractLazyInitializer.setReadOnly(AbstractLazyInitializer.java:288)
at
org.hibernate.proxy.AbstractLazyInitializer.setSession(AbstractLazyInitializer.java:134)
at
org.hibernate.engine.StatefulPersistenceContext.reassociateProxy(StatefulPersistenceContext.java:573)
at
org.hibernate.engine.StatefulPersistenceContext.unproxyAndReassociate(StatefulPersistenceContext.java:618)
at
org.hibernate.event.def.DefaultLockEventListener.onLock(DefaultLockEventListener.java:67)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:774)
at org.hibernate.impl.SessionImpl.fireLock(SessionImpl.java:766)
at org.hibernate.impl.SessionImpl.access$600(SessionImpl.java:156)
at org.hibernate.impl.SessionImpl$LockRequestImpl.lock(SessionImpl.java:2369)
at
com.eads.impact.base.impl.coredb.DefaultPersistenceService.lock(DefaultPersistenceService.java:428)
... 7 more
The bug is quite odd because it is telling me that I need to associate the entity with my
session but that is what I'm trying to do! Thanks for any feedback.
--
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