Skip to content

WriteConflict when using Mongo transactions #1208

@jkloecknerneuland

Description

@jkloecknerneuland

When using Javers with MongoDB and transaction support enabled, writing multiple commits at the same yields a WriteConflict error. An expected behavior would probably be to retry the commit or transaction.

Steps To Reproduce
I have a runnable test case which isolates the bug and allows Javers Core Team to easily reproduce it. I have pushed this test case to my fork of this repository:
https://github.com/jkloecknerneuland/javers/blob/master/javers-spring-boot-starter-mongo/src/test/groovy/org/javers/spring/boot/mongo/JaversMultipleTransactionsMongoTest.groovy

Javers' Version
6.6.5

Additional context
This is probably because the counter in the jv_head_id collection cannot be updated, because its blocked by another transaction.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions