6 Replies Latest reply on Sep 16, 2007 4:26 AM by fhh

    Manual flush not working

    kimlord

      I am trying to do some post processing after a record is entered into a database and am finding the flush is not causing the record to be written. This is my code:

       @Override
       public String persist() {
       String retval = super.persist();
       EntityManager em = (EntityManager)Component.getInstance("entityManager", true);
       em.flush();
       moveTempRecord();
       return "success";
       }
      
      public void moveTempRecord() {
       log.info("Calling UpdateDB_NID_SUB.loadSubTargetStrength");
       UpdateDB_NID_SUB ACINTDatabase_loader = null;
       ACINTDatabase_loader.loadSubTargetStrength();
       }


      In stepping through the code, the problem is that the records are not there for the moveTempRecord method to work. I thought the flush would take care of that. If there is another way to do this, please let me know.

      Thank you,
      Kim