}
em.getTransaction().commit();
} catch (Exception ex) {
String msg = ex.getLocalizedMessage();
if (msg == null || msg.length() == 0) {
ItemstatPK id = itemstat.getItemstatPK();
if (findItemstat(id) == null) {
throw new NonexistentEntityException("The itemstat with id " + id + " no longer exists.");
}
}
throw ex;