5 Replies Latest reply on Aug 31, 2008 8:45 PM by R Morris

    EntityManager cannot persist

    Yuriy ZUbarev Newbie

      It's a pretty basic set-up. There are EntityHome and POJO classes. The first one raises an event and the second one consumes it. The entityManager in the POJO is good for finding entities but does absolutely nothing when I try to persist/update an entity (no log output whatsoever).


      public abstract class PartyHome<P extends Party> extends EntityHome<P> {
        @In
        private Events events;
      
        @Override
        public String update() {
          String result = super.update();
          this.events.raiseAsynchronousEvent("party.changed", getInstance().getId());
          return result;
        }
      }
      




      @Name("partyObserver")
      public class PartyObserver {
      
        @Logger
        private Log log;
      
        @In
        EntityManager entityManager;
      
        @Observer("party.changed")
        public void handleChangedParty(long partyId) {
          Party party = this.entityManager.find(Party.class, partyId); // this works
          ...
          this.entityManager.persist(client); // this doesn't !!!
        }
      }



      Any hints?