Skip to content

Session.rollback() can commit #2389

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Andrew Lutomirski (@amluto)

Much to my surprise, it is possible to add an object to a database via the ORM and commit it by calling Session.rollback(). This is IMO a rather nasty data corruption bug. The script below will 100% reliably commit an object to a sqlite database on python-sqlalchemy-0.7.3-1.fc16 from Fedora. It seems to work on mysql and on sqlalchemy 0.6 from Ubuntu as well.

Marking as highest priority because this can (and did!) cause data corruption. Admittedly, I can't trigger the problem without a slight abuse of the API so far.


Attachments: sqlalchemy_rollback_bug.py

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockerissue that must be resolved asap as it is preventing things from workingbugSomething isn't workingorm

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions