title: spring + hibernate: manually commit the transaction at end
body: <p>I am using spring mvc and hibernate</p>
  
  <pre><code>@Controller
  public class COACategoriesController {
  
  protected static Logger log = Logger.getLogger(COACategoriesController.class);
  
  
  @Resource(name="COACategoriesService")
  private COACategoriesService obj_coacs;
  @Resource(name="COAMaintenanceService")
  private COAMaintenanceService obj_coams;
  
   @RequestMapping(value = "/addCoaCategory", method = RequestMethod.POST)
   public String addCoaCategory(@RequestParam("conCatName") String coaCatName, Model model) {
  
       Date sysdate = null;
       String Message="";
       try{
  
       sysdate = new Date();
  
  
       COACategoriesModel model1 = new COACategoriesModel( coaCatName, 1, "", sysdate , 0);
  
       COAMaintenanceModel account =  new COAMaintenanceModel();
          account.setDiscription("Test Description");
          account.setCategoryId(model1);
  
          Message="Fail-First";
          obj_coacs.AddCOACategories(model1);
  
  
          Message="Fail-Second";
          obj_coams.AddCOAMaintenance (account);
  
  
          Message="Add Successfully";
       }catch(Exception ex){
           log.error("Exception.."+ex);
           model.addAttribute("success", Message);
       }
  
  
  
          return "fin/category";
      }
  
  
  
  }
  </code></pre>
  
  <p>How I commit the transaction manually as all the transactions save successfully, if any transaction fails to insert , rollback all the transactions in catch block. ?</p>
  
  <p>I am using spring mvc and hibernate  </p>