3 Replies Latest reply on Apr 18, 2010 6:13 PM by Gabor Jakab

    One Transaction across multiple methods

    Hai-Yun Du Newbie

      Is it possible to have one method start a transaction and another method finish it?


      In the following I want add() to start the transaction and save to commit it, but the flushmode is not getting set at all and the record gets persisted at the end of add():




      @Name("personPage")
      @Scope(ScopeType.CONVERSATION)
      @Transactional
      public class PersonPage implements Serializable {
      
           @Begin(join=true, flushMode=FlushModeType.MANUAL)
           public void add() {          
                personHome.persist();
           }
      
           @End
           public void save() {
                personHome.getEntityManager().flush();
           }
      }