我需要知道如何确保容器关闭 EMF(使用 wildfly 8.0 和 hibernate-jpa)。
每次我取消部署我的应用程序时,WeldJpaInjectionServices$EntityManagerResourceReferenceFactory 的一个实例都会保留在持有 EMF 实例的内存中。
这会在某些部署/取消部署后导致 OOM 异常。
我没有在我的代码中使用 EMF 引用,只有一个带有 @Produces 和 @PersistenceContext 注释的 EntityManager。
它发生在 wildfly 8.0、8.1 和 9.0alpha 以及 java 7 和 8 上。