Solve login bug of nested transaction:
Must commit and null transaction before function return.