From f62913ba1cd53f58930156858e9a459210584967 Mon Sep 17 00:00:00 2001 From: Gail Badner Date: Thu, 11 Apr 2019 19:38:04 -0700 Subject: [PATCH] HHH-13364 : Query.getSingleResult and getResultList() throw PessimisticLockException when pessimistic lock fails with timeout --- .../org/hibernate/query/internal/AbstractProducedQuery.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java b/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java index ae2eb458af..8598fbfc77 100644 --- a/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java +++ b/hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java @@ -1535,7 +1535,7 @@ public abstract class AbstractProducedQuery implements QueryImplementor { throw new IllegalArgumentException( e ); } catch (HibernateException he) { - throw getExceptionConverter().convert( he ); + throw getExceptionConverter().convert( he, getLockOptions() ); } finally { afterQuery(); @@ -1581,7 +1581,7 @@ public abstract class AbstractProducedQuery implements QueryImplementor { return uniqueElement( list ); } catch ( HibernateException e ) { - throw getExceptionConverter().convert( e ); + throw getExceptionConverter().convert( e, getLockOptions() ); } }