EntityManager em = entityManagerFactory.createEntityManager();
try {
TypedQuery<DatabaseIdentification> q = em.createNamedQuery("DatabaseIdentification.findSchemaId", DatabaseIdentification.class);
DatabaseIdentification di = q.getSingleResult();
if (!schemaId.equals(di.getValue())) {
String errMsg = "Mismatched schemaID.\nDeployed schema ID is " + di.getValue() +
"\nbut MCT requires schema ID " + schemaId;
LOGGER.error(errMsg);
throw new RuntimeException (errMsg);
}
} finally {