Announcement Announcement Module
No announcement yet.
declarative way for setting mongo readprefference/writeconcern Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • declarative way for setting mongo readprefference/writeconcern


    I would like to discuss a feature, maybe called "declarative MongoTx", which I need much more than the possibility of calculating a WriteConcern based on a MongoAction, as I think more in usecases greater than on mongo call.

    So mongo is eventually consistent and as a user of mongo you know that and are happy with that, but sometimes you might have the need to some stuff really against the actual data (primary) and as you do critical stuff you want to be 'REPLICA_SAFE' as the other times reading from secondaries is absolute fine as the writeConcern NONE.

    so what I have done for our project (yum-repo-server)

    @MongoTx(readPreference = "primary", writeConcern = "REPLICAS_SAFE")
    public void doMyMissionCriticalStuff() {
    And now I have a similar behavior like @Transactional with spring-data, regarding the isolation level, but NO rollback or so.

    What do you think about my idea and do you have similar needs?


  • #2
    This looks like cool stuff! Would you mind creating a ticket in our JIRA and simply use the posting's text as description? We can take it from there then.


    • #3
      Issue created: