title: persistence within a flow
body: <p>I implemented a small web-app with spring 3.0, spring-webflow 2.3, zk 5.0.7, zkspring 3.0 and hibernate. </p>
  
  <p>One of the flows shows a taskboard (zk-borderlayout) with panels on it representing the tasks. If the user adds new task I start a new subflow with flow-managed persitence. The new task is persisted at the end of the flow. Everythings works fine. </p>
  
  <p>Besides that the user is able to drag and drop the panel on the taskboard in order to change the status ("not startetd", "ongoing" ...) of the task. The new status of the task should be persisted within the mentioned flow not at the end. I realized this functionality by calling special update method of the DAO (see below) in the onDrop listener of the component. That works also fine.</p>
  
  <pre><code>    public void updateNow(Task task) {
      EntityManager em = getJpaTemplate().getEntityManagerFactory().createEntityManager();
      EntityTransaction tx = em.getTransaction();
      tx.begin();
      em.merge(task);
      tx.commit();
  }
  </code></pre>
  
  <p>I read this <a href="http://www.ibm.com/developerworks/java/library/j-springwebflow/index.html" rel="nofollow">article</a> about flow-managed persitence and I ask myself if this is the right way to persist changes prior to the  of my flow. </p>
  
  <p>Any suggestions?</p>