From 9f215c84759193ca852423cdee961b2ed53284cf Mon Sep 17 00:00:00 2001 From: akotlyarov Date: Sat, 25 Jan 2014 22:40:16 +0200 Subject: [PATCH] HHH-7205: Added catching exception for executing session.get when session cache contains proxy for non-existing object --- .../src/main/java/org/hibernate/internal/SessionImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java index 334dd709a0..c21066be5f 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/SessionImpl.java @@ -2550,11 +2550,14 @@ public final class SessionImpl extends AbstractSessionImpl implements EventSourc try { fireLoad( event, LoadEventListener.GET ); success = true; - return event.getResult(); + } + catch (ObjectNotFoundException e) { + // if session cache contains proxy for non-existing object } finally { afterOperation( success ); } + return event.getResult(); } }