Refactored connection commit and rollback to be explicit.