Skip to content

Commit f1a5b5b

Browse files
committed
HHH-15848 clean up unnecessary logging and tx stuff in Session.isDirty()
1 parent 3501cfd commit f1a5b5b

File tree

1 file changed

+8
-14
lines changed

1 file changed

+8
-14
lines changed

hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1439,22 +1439,18 @@ public void autoPreFlush(){
14391439
.fireEventOnEachListener( this, AutoFlushEventListener::onAutoPreFlush );
14401440
}
14411441

1442-
1443-
14441442
@Override
14451443
public boolean isDirty() throws HibernateException {
14461444
checkOpen();
1447-
pulseTransactionCoordinator();
1448-
log.debug( "Checking session dirtiness" );
14491445
if ( actionQueue.areInsertionsOrDeletionsQueued() ) {
1450-
log.debug( "Session dirty (scheduled updates and insertions)" );
14511446
return true;
14521447
}
1453-
DirtyCheckEvent event = new DirtyCheckEvent( this );
1454-
fastSessionServices.eventListenerGroup_DIRTY_CHECK
1455-
.fireEventOnEachListener( event, DirtyCheckEventListener::onDirtyCheck );
1456-
delayedAfterCompletion();
1457-
return event.isDirty();
1448+
else {
1449+
final DirtyCheckEvent event = new DirtyCheckEvent( this );
1450+
fastSessionServices.eventListenerGroup_DIRTY_CHECK
1451+
.fireEventOnEachListener( event, DirtyCheckEventListener::onDirtyCheck );
1452+
return event.isDirty();
1453+
}
14581454
}
14591455

14601456
@Override
@@ -1493,10 +1489,8 @@ public void forceFlush(EntityEntry entityEntry) throws HibernateException {
14931489
@Override
14941490
public void forceFlush(EntityKey key) throws HibernateException {
14951491
if ( log.isDebugEnabled() ) {
1496-
log.debugf(
1497-
"Flushing to force deletion of re-saved object: %s",
1498-
infoString( key.getPersister(), key.getIdentifier(), getFactory() )
1499-
);
1492+
log.debugf("Flushing to force deletion of re-saved object: "
1493+
+ infoString( key.getPersister(), key.getIdentifier(), getFactory() ) );
15001494
}
15011495

15021496
if ( persistenceContext.getCascadeLevel() > 0 ) {

0 commit comments

Comments
 (0)