[nobug] attempt to not run out of connections in jpa-lrg on mysql
Signed-off-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java
index 24334fa..da203ce 100644
--- a/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java
+++ b/jpa/eclipselink.jpa.test/src/org/eclipse/persistence/testing/framework/junit/JUnitTestCase.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 1998, 2017 Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2018 Oracle and/or its affiliates. All rights reserved.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
* which accompanies this distribution.
@@ -618,7 +618,7 @@ public static EntityManagerFactory getEntityManagerFactory(String persistenceUni
// force closing of other persistence units to avoid Sybase running out of connections.
if (!persistenceUnitName.equals("default")) {
- if (emfNamedPersistenceUnits.containsKey("default") && getServerSession().getPlatform().isSybase()) {
+ if (emfNamedPersistenceUnits.containsKey("default") && (getServerSession().getPlatform().isSybase() || getServerSession().getPlatform().isMySQL())) {
Iterator<Map.Entry<String, EntityManagerFactory>> factories = emfNamedPersistenceUnits.entrySet().iterator();
while (factories.hasNext()) {
Map.Entry<String, EntityManagerFactory> entry = factories.next();