fix race condition in commit and rollback listeners, remove waitForTransaction method