ensure endTransactionObserve is called always when commit or rollback happens