Spring Boot and MongoDB Transactions

Sdílet
Vložit
  • čas přidán 14. 12. 2020
  • Enjoy! :-)
    Thank you for commenting and asking questions.
    Discord server - Where we discuss programming languages and tech - Please use the right channel to your input / question :)
    / discord
    Library sign up referral link:
    lbry.tv/$/invite/@mikemoeller...
    Get 25 % discount on your Minecraft servers at Shockbyte.com by using this referral link:
    shockbyte.com/billing/aff.php...
    Checkout or buy the Introduction to Algorithms book at Amazon:
    amzn.to/2RK3Lur
    The code is located here:
    github.com/ekim197711/springb...
    Follow me on twitter:
    / mikemoelnielsen
    Chat on Discord:
    / discord
    Support me on Patreon:
    / mikemoellernielsen
    As an Amazon Associate I earn from qualifying purchases.
    Check out the stuff that I like:
    kit.co/MikeMoellerNielsen/my-...
    Background nature video:
    Video by Engin Akyurt from Pexels
    www.pexels.com/video/beauty-o...
  • Věda a technologie

Komentáře • 30

  • @gugenberg342
    @gugenberg342 Před 3 lety +1

    Thank you so much for expline, Mike !

  • @mustafaasaad3296
    @mustafaasaad3296 Před 2 lety

    thank you for this wonderful explanation :)

  • @pulato000
    @pulato000 Před rokem +1

    Hey Mike, thanks for content
    Transaction in MongoDB Atlas works well without additional configuration, tested)

  • @abdullahsholapur9933
    @abdullahsholapur9933 Před 3 lety +1

    Thanks mike for wonderful explanation,
    can we use mongo transaction for different collection corresponding to different dbs, will that be able to support atomacity?

    • @MikesTechCorner
      @MikesTechCorner  Před 3 lety +1

      Very good question. I think so. But try it out in a test setup

  • @pratikkanuga5392
    @pratikkanuga5392 Před rokem

    Hi Sir! Thank you for the video and very clear explanation. Can you please tell me what changes we need to do if we are performing Transactions with ReactiveMongoDB or it would be great if you could bring video on it? waiting for your response.

  • @yegor.karimov
    @yegor.karimov Před rokem

    First of all thanks for the explanation and your videos!
    My question is - can we just set retryWrites to false within the Spring Boot setup?
    Disabling it seems to be an option for the local development, however, setting it in the uri parameter did not work for me.

  • @rahhi9792
    @rahhi9792 Před 3 lety +1

    awesome content sir.
    plz make a video on oauth with react or angular. Google login or Facebook login

  • @jhewerkstatt5526
    @jhewerkstatt5526 Před 3 lety +1

    Nice content. But why is @Autowired annotation not recommended for production?

    • @MikesTechCorner
      @MikesTechCorner  Před 3 lety +1

      @Autowired is only used in unittests. Or else the best practice is to use constructor injection so the code easily can be tested in a unittest using ie. mockito.

  • @HarshaVardhan-jf9sd
    @HarshaVardhan-jf9sd Před 2 lety +1

    Does a transaction manager also, handle concurrent requests at the same time for same API trying to create DB records?

    • @MikesTechCorner
      @MikesTechCorner  Před 2 lety

      Each request with transaction has to wait for ealier transactions to complete

  • @madinabonualisherova8935
    @madinabonualisherova8935 Před 3 lety +1

    Cool explanation:) Could you use dark mode for the next time?

    • @MikesTechCorner
      @MikesTechCorner  Před 3 lety +3

      No I need to use light mode because it is easier to see on the videos. + It lights up my face better than the dark mode. Yes yes I should buy more light for the office... :-)

  • @nandanasworld2817
    @nandanasworld2817 Před 2 lety +1

    Will it work with different collections?

  • @user-yy1xe5vr4f
    @user-yy1xe5vr4f Před rokem

    This is not working with AWS DocumentDB. Transactional rollback is not happening.

    • @MikesTechCorner
      @MikesTechCorner  Před rokem +1

      No the approach doesn't work any longer. I think a manual rollback is the best solution.

    • @user-yy1xe5vr4f
      @user-yy1xe5vr4f Před rokem

      @@MikesTechCorner Yeah, we have to rollback manually but I can't believe AWS DocumentDB doesn't support rollbacks with @Transactional annotation. Looks like either AWS DocumentDB with SpringBoot is not used widely.

    • @user-yy1xe5vr4f
      @user-yy1xe5vr4f Před rokem

      The above solution works perfectly well with MongoDB V4.0 onwards.

    • @MikesTechCorner
      @MikesTechCorner  Před rokem

      I don't know. It is rare to use 2 databases. Usually one system = one database. 2 databases = 2 systems.