title: Best practice to return a result Flag after saveOrUpdate in hibernate?
body: <p>Often we have to use some of the methods which don't return anything useful. If I invoke saveOrUpdate() in hibernate , I don't know whether it has been performed successfully . 
  I use a implementation like this (which I think is a bit awkward) :</p>
  
  <pre><code>public int saveOrUpdateA(A a) {
          int resultFlag = 0 ;
      try {
          // obtaining session is omitted
          session.saveOrUpdate(a);
          resultFlag = 1 ;    
      } catch (Exception e) {
          e.printStackTrace();
      } 
      return resultFlag ;
  }
  </code></pre>
  
  <p>How do you do this ? Any good idea ?</p>
  
  <p><strong>Exception should be caught in DAO layer or Service Layer ?</strong></p>