Skip to content

sql2o can't rolback ? #342

Description

@mailtous

The "connection.rollback()" has execute,But data still updated.
EG :

    public void write() {
        try (Connection connection = sql2o.beginTransaction()) {
            Query q = connection.createQuery(" UPDATE `users` set name = 'alice' where id = 1");
            q.setAutoDeriveColumnNames(true);
            q.executeUpdate();
            // DO SAVE
            connection.commit();
            // TEST DATA ROLLBACK, The "connection.rollback()" has execute but data still updated.
            connection.rollback();
        }
    }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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