Fix error 'ERROR: Cannot commit when autoCommit is enabled.' in #2