I have the following in an entityhome class and am finding that the flush does not cause the record to be written to the database. The record gets written when the method ends. I need the flush to work so that the other method called moveTempRecord() can do some post processing.
@In EntityManager entityManager; @Transactional public String persist() { log.info("Override persist"); getEntityManager().joinTransaction(); getEntityManager().persist( getInstance() ); getEntityManager().flush(); moveTempRecord(); return "success"; }
How does moveTempRecord(); look like? Post the code here
And why didn't you use entityManager.flush() instead?