From edd66d96dd63011449b05abba21c8ba9428af06e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 25 Mar 2022 18:06:39 +0100 Subject: [PATCH] Fix accidental use of deprecated setFlushMode method Closes gh-28234 --- .../orm/jpa/vendor/HibernateJpaDialect.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java b/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java index a6d82beb63c1..72ff21ce8d9f 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2022 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -80,7 +80,7 @@ * @author Costin Leau * @since 2.0 * @see HibernateJpaVendorAdapter - * @see org.hibernate.Session#setFlushMode + * @see org.hibernate.Session#setHibernateFlushMode * @see org.hibernate.Transaction#setTimeout */ @SuppressWarnings("serial") @@ -360,10 +360,9 @@ public SessionTransactionData(SessionImplementor session, @Nullable FlushMode pr this.readOnly = readOnly; } - @SuppressWarnings("deprecation") public void resetSessionState() { if (this.previousFlushMode != null) { - this.session.setFlushMode(this.previousFlushMode); + this.session.setHibernateFlushMode(this.previousFlushMode); } if (this.needsConnectionReset && this.session.getJdbcCoordinator().getLogicalConnection().isPhysicallyConnected()) {