1 Reply Latest reply on Dec 22, 2009 7:05 PM by Vincent Wiencek

    postInitialization event

    Vincent Wiencek Newbie

      Hi, I'm trying to populate my datbase when my seam application starts.
      To do so, I've an ApplicationInit class :


      @Name("applicatinInit")
      @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
      public class ApplicationInit{
          @Logger private Log log;
          @In EntityManager entityManager;
          @In(create=true) private PasswordManager passwordManager;
      
          @Observer("org.jboss.seam.postInitialization")
          public void init(){
              //Do some stuff
              entityManager.persist(myObj);
          }
      }
      


      My application launches, the init method launches correctly (I see log messages). But nothing is inserted in my database ?
      Any clue ?


      Thank you