diff --git a/core/src/main/java/org/hibernate/engine/EntityEntry.java b/core/src/main/java/org/hibernate/engine/EntityEntry.java index 7c69186c0a..7667ece2dd 100644 --- a/core/src/main/java/org/hibernate/engine/EntityEntry.java +++ b/core/src/main/java/org/hibernate/engine/EntityEntry.java @@ -74,7 +74,8 @@ public final class EntityEntry implements Serializable { final boolean lazyPropertiesAreUnfetched) { this.status=status; this.previousStatus = null; - this.loadedState=loadedState; + // only retain loaded state if the status is not Status.READ_ONLY + if ( status != Status.READ_ONLY ) { this.loadedState = loadedState; } this.id=id; this.rowId=rowId; this.existsInDatabase=existsInDatabase;