1 Reply Latest reply on Feb 21, 2011 8:10 PM by Tim Evers

    rollback from entityHome

    kanwar sangha Newbie

      Hi,


      We have a requirement where we need to do the following operation -


      1) persist an entity
      2) call a stored procedure in db


      Both need to happen in 1 transaction which should be atomic. We are using entityHome(seam-gen).


      Issue is that if call (2) fails, then how do i do a rollback for (1) ?




      persist(){
      
      super.persist; // 1
      calldbProc(); // 2
      }




      I have tried the following options -


      1)flushmode manual ( this is not supported during create() as per the FAQs for seam)
      2)@ApplicationException ( does not work ) , changes get persisted
      3) Transaction.instance.setRollbackonly() // does not work !


      Any clue ?


      Thanks,
      Kanwar