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.
Merge pull request #4 from jose1984/master

Update transaction calls