title: JPA/Hibernate callback for autocommits
body: <p>I'd like to intercept each event in which an entity is about to be stored in the database. According to <a href="http://www.objectdb.com/java/jpa/persistence/event" rel="nofollow">http://www.objectdb.com/java/jpa/persistence/event</a> I can do that using all @Pre... annotations. It's working, but only when the transaction is being commited when it ends. If a flush happens before a transaction ends, none of the callbacks are triggered.</p>
  
  <p>Is there a way to get around this?</p>
  
  <p>Thanks!</p>