code: public void saveRule(Rule rule, RuleChange change) {
      	rule.setLastModified(new Date());    	
          Session session1 = getHibernateTemplate().getSessionFactory().openSession();
          Transaction tx = session1.beginTransaction();
          session1.saveOrUpdate(rule);
          session1.save(change);
          tx.commit();
          session1.close();
      }
docs: Save a rule and a change log entry in one go. (Uses a transaction).
  @param rule
  @param change