Skip to content

Using PostgreSQL's returning doesn't mark session dirty #2156

@gavlyukovskiy

Description

@gavlyukovskiy

There is a workaround in #1293 to use select + flushCache=true for queries like INSERT ... RETURNING ..., but it looks like this workaround doesn't behave the same way update does. If you look at DefaultSqlSession it marks session dirty only on update/delete/insert, but not on select meaning that query will not be rolled back.

Currently we have to use copy of DefaultSqlSession (and therefore copy of DefaultSqlSessionFactory) to mitigate this issue by marking session dirty on selects as well. Given that Postgres is quite popular database I assume many people might be affected by that.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions