Skip to content

connection.rollback() undoes effect of an insert executed with autocommit = True  #2

@srprogrammer

Description

@srprogrammer

Another simple SA dialect compliance suite test case which fails is tests/test_suite.py::AutocommitTest_mssql+ctds_14_0_3015_40::()::test_autocommit_on

It reduces itself to somethng like (in ctds terms conn is one of its DB-API-level Connection's):

conn.autocommit = True
trans = conn.begin()
conn.cursor().execute("INSERT ...")
trans.rollback()
# Here existence of the row inserted two lines above is tested. It should exist

It fails because the inserted row does not exist. If I comment out the rollback() then things do work as expected.

But rollback() (and FWIW begin()) shouldn't have effect on the row inserted by execute() as it happened under the "protection" of autocommit = True right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions