HHH-12718 Compute dirtiness using whatever method is appropriate after a flush event interception

We used to have a simpler version of the dirtyCheck() method after an
interception, but that's not enough.
This commit is contained in:
Yoann Rodière 2018-07-12 16:32:54 +02:00 committed by Guillaume Smet
parent 47107e3e88
commit e53e0ef790
2 changed files with 1 additions and 15 deletions

View File

@ -333,19 +333,7 @@ public class DefaultFlushEntityEventListener implements FlushEntityEventListener
//now we might need to recalculate the dirtyProperties array //now we might need to recalculate the dirtyProperties array
if ( intercepted && event.isDirtyCheckPossible() ) { if ( intercepted && event.isDirtyCheckPossible() ) {
if ( !event.isDirtyCheckHandledByInterceptor() ) { dirtyCheck( event );
int[] dirtyProperties;
if ( event.hasDatabaseSnapshot() ) {
dirtyProperties = persister.findModified( event.getDatabaseSnapshot(), values, entity, session );
}
else {
dirtyProperties = persister.findDirty( values, entry.getLoadedState(), entity, session );
}
event.setDirtyProperties( dirtyProperties );
}
else {
dirtyCheck( event );
}
} }
return intercepted; return intercepted;

View File

@ -18,7 +18,6 @@ import org.hibernate.cfg.Configuration;
import org.hibernate.persister.entity.EntityPersister; import org.hibernate.persister.entity.EntityPersister;
import org.hibernate.type.Type; import org.hibernate.type.Type;
import org.hibernate.testing.FailureExpected;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import org.junit.Test; import org.junit.Test;
@ -76,7 +75,6 @@ public class CustomDirtinessStrategyTest extends BaseCoreFunctionalTestCase {
} }
@Test @Test
@FailureExpected(jiraKey = "HHH-12718")
public void testCustomStrategyWithFlushInterceptor() { public void testCustomStrategyWithFlushInterceptor() {
Session session = openSession(); Session session = openSession();
session.beginTransaction(); session.beginTransaction();