I've started to learn Reactive paradigm, so I'm pretty new in this topic. I created a sample app which uses Spring R2DBC to connect to PostgreSQL DB.
I created a Rest Controller for fetching and saving data in DB to better understand a concept.
I expected to meet the following scenario:
- I'm running findById query from reactive repository class looking for id, which does not exist in DB yet. I'm subscribing on the returned Mono object
- I'm saving the entity with id queried in (1)
- Query from (1) is constantly listening for changes in DB and finds added entity immediately
Unfortunately it does not work in such way. Basically point no (3) is never happening and I need to fire query from (1) manually to hit the DB again.
My question is - am I doing something wrong or understanding reactive database concept incorrectly?
I feel, needing some explanation here. I really appreciate your help at this issue.