Skip to content

Preserving order on multiple inserts #6

@mmanciop

Description

@mmanciop

What are the guarantees in terms of insertion order for R2dbcRepository#saveAll for new items? Some experiments I have been playing around with seem to show that the insertion order is not honored, which makes sense since SimpleR2dbcRepository#saveAll is just a flatMap built on SimpleR2dbcRepository#save, and the latter queues an asynchronous job on the TcpResources pool of Reactor-Netty.

While our-of-order updates is pretty much a non-issue in my experience, not honoring the insertion order is very confusing when the database is generating sequential primary keys.

For reference, #7 enhances the tests to show sporadic failures due to the insertion order not been deterministic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions