Skip to content

Bug: GlobalIdPK cache is not clear when transaction rollback has been performed #467

@YaraslauBarysenka

Description

@YaraslauBarysenka

Expectations versus reality

Preconditions

  • We use Javers 2.7.1 version.
  • A database have already populated with data.
  • Transaction has been started.
  • Audit has happened.
  • The transaction is failed and the transaction rollback was performed.

Expected Result

  • The globalIdPkCache (in GlobalIdRepository class) should be cleared when a transaction rollback was performed.

Current Result

  • Necessary rows were rollbacked from jv_global_id table, but globalId is present in cache(GlobalIdRepository class). When we try to make audit with an entity from previoust transaction and javers commit operation get globalId from cashe, the globalId is not present in database. If that Javers tries to create new snapshot then we receive an exception(see exception here: exception.txt), because Javers inserts not existing primary key.

Runnable test case

The application to reproduce issue here: javers-bug-example.zip

Please, read an instruction about how to reproduce the issue using the application here: instrution.txt

P. S.

If you have questions, please let's me know.
Guys, thank you for your work. It is very helpful for us.
Thank you in advance.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions