Fix: Invoke flush more than one time per transaction.