From b2a6a572d3855699752b54e44a3415f902da952f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Fri, 24 Mar 2017 11:07:14 +0100 Subject: [PATCH] Drop outdated DeferredQueryInvocationHandler.finalize() implementation Issue: SPR-15363 --- .../orm/jpa/SharedEntityManagerCreator.java | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java b/spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java index 8c51e2acb72..fb5f21f6715 100644 --- a/spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java +++ b/spring-orm/src/main/java/org/springframework/orm/jpa/SharedEntityManagerCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2017 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. @@ -384,16 +384,6 @@ public abstract class SharedEntityManagerCreator { } } } - - @Override - protected void finalize() throws Throwable { - // Trigger explicit EntityManager.close() call on garbage collection, - // in particular for open/close statistics to be in sync. This is - // only relevant if the Query object has not been executed, e.g. - // when just used for the early validation of query definitions. - EntityManagerFactoryUtils.closeEntityManager(this.em); - super.finalize(); - } } }