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