Are Spring Data MongoDB connection streams tied?
According to this:
It looks like connections are being pulled from the internal connection pool and returned "per request"
so the database connection is not thread-specific.
I haven't found a way to override this yet. Perhaps there is another driver, or a setting that I haven't found yet.
Edit: Apparently I haven't read the article enough. You should be able to use db.requestStart () to make sure the connection is maintained for the stream.
There are similar mentions here for C # and Python:
source to share