borinquenkid commented on code in PR #15568:
URL: https://github.com/apache/grails-core/pull/15568#discussion_r3453833376
##########
grails-data-hibernate7/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/HibernatePersistenceContextInterceptor.java:
##########
@@ -97,47 +98,48 @@ public void destroy() {
try {
disconnected.clear();
SessionFactoryUtils.closeSession(holder.getSession());
- }
- catch (RuntimeException ex) {
+ } catch (RuntimeException ex) {
LOG.error("Unexpected exception on closing Hibernate Session", ex);
}
}
public void disconnect() {
- if (getSessionFactory() == null) return;
- try {
- disconnected.add(
- getSession(false).disconnect()
- );
-
- }
- catch (Exception e) {
- // no session ignore
- }
+ throw new UnsupportedOperationException("disconnect is not supported
by Hibernate 6");
Review Comment:
Fixed — both messages now say Hibernate 7.
##########
grails-data-hibernate7/grails-plugin/src/main/groovy/org/grails/plugin/hibernate/support/HibernatePersistenceContextInterceptor.java:
##########
@@ -97,47 +98,48 @@ public void destroy() {
try {
disconnected.clear();
SessionFactoryUtils.closeSession(holder.getSession());
- }
- catch (RuntimeException ex) {
+ } catch (RuntimeException ex) {
LOG.error("Unexpected exception on closing Hibernate Session", ex);
}
}
public void disconnect() {
- if (getSessionFactory() == null) return;
- try {
- disconnected.add(
- getSession(false).disconnect()
- );
-
- }
- catch (Exception e) {
- // no session ignore
- }
+ throw new UnsupportedOperationException("disconnect is not supported
by Hibernate 6");
}
public void reconnect() {
Review Comment:
Fixed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]