I'm using the EntityManager to persist data into my database.
public void save(X x){
entityManager.persist(x);
entityManager.flush();
triggerDataChange();
}
After flushing the data I call the triggerDataChange() Method to send a message to an external component which depends on the newly written data.
Question: Can I rely on the flush method returning after the data has been written to database successfully?
Thanks for your help.