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