Skip to content

Commit

Permalink
convert comment to method name
Browse files Browse the repository at this point in the history
  • Loading branch information
asolntsev committed May 24, 2017
1 parent b9e0176 commit 50f5b13
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions framework/src/play/db/jpa/JPAPlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,18 @@ public static String getDefaultDialect(Configuration dbConfig, String driver) {

@Override
public void onApplicationStop() {
// Close all presistence units
for(EntityManagerFactory emf: JPA.emfs.values()) {
if(emf.isOpen()){
closeAllPersistenceUnits();
}

private void closeAllPersistenceUnits() {
for (EntityManagerFactory emf : JPA.emfs.values()) {
if (emf.isOpen()) {
emf.close();
}
}
JPA.emfs.clear();
JPA.emfs.clear();
}

@Override
public void afterFixtureLoad() {
if (JPA.isEnabled()) {
Expand Down

0 comments on commit 50f5b13

Please # to comment.