HHH-4948 : Session.flush() does not always cascade save or update to read-only or immutable entities
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18872 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
5e71ea4c55
commit
d26e4f1cad
|
@ -285,11 +285,9 @@ public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener
|
|||
Object entity,
|
||||
EntityPersister persister) throws HibernateException {
|
||||
|
||||
if ( !persister.isMutable() ) {
|
||||
log.trace( "immutable instance passed to doUpdate(), locking" );
|
||||
reassociate( event, entity, event.getRequestedId(), persister );
|
||||
}
|
||||
else {
|
||||
if ( !persister.isMutable() ) {
|
||||
log.trace( "immutable instance passed to performUpdate()" );
|
||||
}
|
||||
|
||||
if ( log.isTraceEnabled() ) {
|
||||
log.trace(
|
||||
|
@ -329,7 +327,7 @@ public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener
|
|||
|
||||
source.getPersistenceContext().addEntity(
|
||||
entity,
|
||||
Status.MANAGED,
|
||||
( persister.isMutable() ? Status.MANAGED : Status.READ_ONLY ),
|
||||
null, //cachedState,
|
||||
key,
|
||||
persister.getVersion( entity, source.getEntityMode() ),
|
||||
|
@ -350,8 +348,6 @@ public class DefaultSaveOrUpdateEventListener extends AbstractSaveEventListener
|
|||
}
|
||||
|
||||
cascadeOnUpdate( event, persister, entity );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean invokeUpdateLifecycle(Object entity, EntityPersister persister, EventSource source) {
|
||||
|
|
Loading…
Reference in New Issue