Skip to content

Transaction fails when entity has set @Durability #2027

@jakov222

Description

@jakov222

Hey, I am trying to save few documents in a transaction. Entity of the document is annotated with @Durability(MAJORITY_AND_PERSIST_TO_ACTIVE). Transaction fails with Transaction has failed with cause 'java.lang.IllegalArgumentException: withDurability is not supported in a transaction'
Is this intended? Probably has something to do with this comment #1487 (comment)

tagging @programmatix

// edit
ok, I can clearly see now that this is intentional. Could you please share why? I wanted to achieve this scenario - annotate entity with @Durability. Have repository with reference to CrudRepository with durable save methods and other @Transactional method that does some operations

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