Are Spring Data MongoDB connection streams tied?
1 answer
According to this:
http://docs.mongodb.org/ecosystem/drivers/java-concurrency/#java-driver-concurrency
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:
http://docs.tokutek.com/tokumx/tokumx-transactions.html#tokumx-transactions-multi-statement-drivers
0
source to share