用一个transation就可以实现啊!同时更新同时rollback阿,当更新失败时!这些都是类似的啊!

解决方案 »

  1.   

    如果用entityBean的话用cmr就可以实现
      

  2.   

    不用ejb , 在MVC struts中如何實現?
      

  3.   

    Connection conn=null;
    //todo:get your connection
    conn.setAutoCommit(false);
    //todo:
    //insert into parent table
    //insert into child table
    conn.commit();if you are using hibernate,you can use it's transaction.
      

  4.   

    Connection conn=null;
    //todo:get your connection
    conn.setAutoCommit(false);
    //todo:
    //insert into parent table
    //insert into child table
    conn.commit();if you are using hibernate,you can use it's transaction.
      

  5.   

    先謝謝各位,我想再知道一點:用MVC模式開發 , 在做為View 的jsp頁面如何實現明細表多條記錄的增加 ? 
    而在Controller中又怎樣得到頁面的主從數據? 最好能給點源代碼.初學者,問的可能有點可笑,請見諒!