title: Hibernate 5 and Transaction rollback detection with interceptor
body: <p>We had a Hibernate Interceptor that was intercepting <code>afterTransactionCommit</code> and checking the Transaction for <code>wasCommited()</code>, but we recently upgraded to Hibernate 5.0.7.Final, and hibernate 5 no longer has this call, and when we call the <code>getStatus()</code> function we only every seem to get either <code>ACTIVE</code> or <code>NOT_ACTIVE</code> regardless of the transaction state. </p>
  
  <p>I looked at <code>afterTransactionBegin</code> and the transaction is marked <code>ACTIVE</code>, which is expected, and in <code>beforeTransactionCompletion</code> it is still marked <code>ACTIVE</code>, which again, is expected, but then in <code>afterTransactionCommit</code> it is marked <code>NOT_ACTIVE</code>, which doesn't make a sense to me. I would have expected one of <code>COMMITTED, ROLLED_BACK, FAILED_COMMIT</code>. I get this no matter if the transaction state, even if I throw an exception which causes a rollback, I still don't see any status other than <code>NOT_ACTIVE</code>.</p>
  
  <p>The reason we are looking for this information is to determine if we need to post some messages to a queue. Basically if the transaction wasn't committed don't post. As of right now with Hibernate 5 I can't seem to find out how to determine programatically if the transaction was successful or not. </p>