public void create(TagBean newTagBean) throws RollbackException { try { Transaction.begin(); createAutoIncrement(newTagBean); Transaction.commit(); } finally { if (Transaction.isActive()) Transaction.rollback(); } }
public void delete(int id, int rid) throws RollbackException { try { Transaction.begin(); TagBean item = read(id); if (item == null) { throw new RollbackException("Step does not exist: id=" + id); } if (rid != item.getRid()) { throw new RollbackException("Step not owned by recipe id:" + rid); } delete(id); Transaction.commit(); } finally { if (Transaction.isActive()) Transaction.rollback(); } }