title: JPA @PreUpdate is not called
body: <p>Could someone explain to me the reason of the following behavior?</p>
  
  <p><code>EntityA</code> is being first created and then persisted using <code>em.persist(..)</code> method. <code>@PrePersist</code> callback is executed before the transaction ends. It works fine.</p>
  
  <p>In the new transaction <code>EntityA</code> is obtained using em query. Then, some operations modifying its persistable fields are executed and this transaction ends. But on <code>em.flush()</code>, the <code>@PreUpdate</code> method is never called nor is <code>@PrePersist</code> (the latter I anticipated). Why? </p>
  
  <p><strong>// EDIT</strong></p>
  
  <p>That's the trace just before failure. "Done materializing entity" is the effect of the first operation in the transaction that fails.</p>
  
  <pre><code>DEBUG: org.hibernate.engine.internal.TwoPhaseLoad - Done materializing entity [com.example.entity#1]
  DEBUG: org.hibernate.event.internal.AbstractFlushingEventListener - Processing flush-time cascades
  DEBUG: org.hibernate.ejb.AbstractEntityManagerImpl - Mark transaction for rollback
  DEBUG: org.springframework.orm.jpa.JpaTransactionManager - Initiating transaction rollback
  DEBUG: org.springframework.orm.jpa.JpaTransactionManager - Rolling back JPA transaction on EntityManager [org.hibernate.ejb.EntityManagerImpl@341a736]
  DEBUG: org.hibernate.engine.transaction.spi.AbstractTransactionImpl - rolling back
  DEBUG: org.hibernate.engine.transaction.internal.jdbc.JdbcTransaction - rolled JDBC Connection
  </code></pre>
  
  <p>Thanks!</p>