Merge pull request #13935 from arthurnn/fix_12566

Make sure transaction state resets after commit