only commit if there is an active transaction