Update transaction calls

With these changes, commit and rollback is used on the open transaction trans_begin and if it is not open on the default transaction.