]
Adrian Pillinger commented on HHH-443:
--------------------------------------
We use a new session in the listener and still encounter this bug.
AssertionFailure occurs with listeners on models with many-to-many
collection.
-------------------------------------------------------------------------------
Key: HHH-443
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-443
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.0.2
Environment: Hibernate version 3.0.2
Oracle9i
Reporter: Tom Kucharski
The problem occurs when insert or update listener is created on hibernate session on
model with many-to-many collection and listener is making some queries with this model.
The listener is needed for checking data integrity , so I need to make some select
clauses within this listener.
That is my code from PreInsertEventListener.onPreInsert() method (some lines were removed
for clearance) :
//I set this on FlushMode.NEVER because StackOverflowError is thrown
event.getSession().setFlushMode(FlushMode.NEVER);
// Function below makes database query using criteria API
String o = listener.validate(event.getEntity(),event.getSession());
if (o != null) {
// I don't know if this is correct, but why not?? I don't catch this exception in
my code and I have auto_close_session and auto_flush_session on true
throw new ConstraintViolationException(o,null,null);
}
// set to default settings
event.getSession().setFlushMode(FlushMode.AUTO);
That's exception from my WebLogic 8.1 server
<2005-05-05 18:05:15 CEST> <Error> <org.hibernate.AssertionFailure>
<000000> <an assertion failure occured (this may indicate a bug in Hibernate, but
is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: collection was not processed by flush()
at org.hibernate.engine.CollectionEntry.postFlush(CollectionEntry.java:144)
at
org.hibernate.event.def.AbstractFlushingEventListener.postFlush(AbstractFlushingEventListener.java:305)
at
org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:28)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:678)
at
pl.softbank.cepik.modris.common.client.util.DefaultModrisClient.updateObject(DefaultModrisClient.java:196)
at
pl.softbank.cepik.modris.dict.common.client.CommonDictModrisClient.insert(CommonDictModrisClient.java:71)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: