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(); - } } }