Moved the autocommit bits to the logical connection part. I think this may help.