+ try {
+ if (entityManager.isOpen()) {
+ entityManager.flush();
+ }
+ } catch (Exception e) { // TODO catch the Entity manager exceptions explicitly and rethrow, but log
+ // the other onees.
+ LOGGER.log(Level.WARNING, "Could not flush entitymanager", e);
+ }