Author: max.andersen(a)jboss.com
Date: 2006-09-21 21:51:29 -0400 (Thu, 21 Sep 2006)
New Revision: 10519
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/AbstractFlushingEventListener.java
Log:
HHH-2093 PERSIST_ON_FLUSH ineffective for recursive object graphs
Modified:
branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/AbstractFlushingEventListener.java
===================================================================
---
branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/AbstractFlushingEventListener.java 2006-09-22
01:50:45 UTC (rev 10518)
+++
branches/Branch_3_2/Hibernate3/src/org/hibernate/event/def/AbstractFlushingEventListener.java 2006-09-22
01:51:29 UTC (rev 10519)
@@ -113,22 +113,23 @@
final Map.Entry[] list = IdentityMap.concurrentEntries(
session.getPersistenceContext().getEntityEntries() );
//safe from concurrent modification because of how entryList() is implemented on
IdentityMap
final int size = list.length;
+ final Object anything = getAnything();
for ( int i=0; i<size; i++ ) {
Map.Entry me = list[i];
EntityEntry entry = (EntityEntry) me.getValue();
Status status = entry.getStatus();
if ( status == Status.MANAGED || status == Status.SAVING ) {
- cascadeOnFlush( session, entry.getPersister(), me.getKey() );
+ cascadeOnFlush( session, entry.getPersister(), me.getKey(), anything );
}
}
}
- private void cascadeOnFlush(EventSource session, EntityPersister persister, Object
object)
+ private void cascadeOnFlush(EventSource session, EntityPersister persister, Object
object, Object anything)
throws HibernateException {
session.getPersistenceContext().incrementCascadeLevel();
try {
new Cascade( getCascadingAction(), Cascade.BEFORE_FLUSH, session )
- .cascade( persister, object, getAnything() );
+ .cascade( persister, object, anything );
}
finally {
session.getPersistenceContext().decrementCascadeLevel();
Show replies by date