--- org/hibernate/event/def/DefaultFlushEntityEventListener.java 2012-02-09 01:26:34.000000000 +0100 +++ org/hibernate/event/def/DefaultFlushEntityEventListener.java 2012-11-12 11:51:17.000000000 +0100 @@ -441,7 +441,6 @@ * Note: this method is quite slow, avoid calling if possible! */ protected final boolean isUpdateNecessary(FlushEntityEvent event) throws HibernateException { - EntityPersister persister = event.getEntityEntry().getPersister(); Status status = event.getEntityEntry().getStatus(); @@ -449,15 +448,13 @@ return true; } else { - + boolean dirtyCollections = hasDirtyCollections( event, persister, status ); + if (dirtyCollections) + { + return true; + } int[] dirtyProperties = event.getDirtyProperties(); - if ( dirtyProperties!=null && dirtyProperties.length!=0 ) { - return true; //TODO: suck into event class - } - else { - return hasDirtyCollections( event, persister, status ); - } - + return dirtyProperties!=null && dirtyProperties.length!=0; } }