Java Code Examples for javax.persistence.EntityManagerFactory.isOpen()

The following are Jave code examples for showing how to use isOpen() of the javax.persistence.EntityManagerFactory class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: minijax   File: CloseUtils.java   Source Code and License Vote up 5 votes
private static void closeEntityManagerFactory(final EntityManagerFactory emf) {
    try {
        if (emf != null && emf.isOpen()) {
            emf.close();
        }
    } catch (final Exception ex) {
        LOG.warn(ex.getMessage(), ex);
    }
}