public static void persist(MacroEntity transientInstance) {
		try {
			EntityTransaction tx = entityManager.getTransaction();
			tx.begin();
			try {
				List<ActionEntity> actions = transientInstance.getActions();
				if (actions != null && actions.size() > 0) {
					for (ActionEntity action : actions) {
						ActionEntityDAO.persist(action);
					}
				}
				entityManager.persist(transientInstance);
				tx.commit();
			} catch (Exception e) {
				log.error("add macro failed", e);
				tx.rollback();
			}
			finally {
				if(tx != null && tx.isActive()) {
					tx.rollback();
				}
			}
		} catch (RuntimeException re) {
			log.error("persist failed", re);
			throw re;
		}
	}