Skip to content

Commit

Permalink
Fix accidental use of deprecated setFlushMode method
Browse files Browse the repository at this point in the history
Closes gh-28234
  • Loading branch information
jhoeller committed Mar 25, 2022
1 parent 35610a5 commit edd66d9
Showing 1 changed file with 3 additions and 4 deletions.
@@ -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.
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit edd66d9

Please sign in to comment.