3

We are evaluating TokuMX so we could use its ACID transaction feature, but we want to use it with Spring Data for MongoDB.

So, here is the question: are MongoDB connections managed by Spring Data thread bounded so that we could take advantage of TokuMX transaction implementation?

Stennie
  • 63,885
  • 14
  • 149
  • 175
Kico Lobo
  • 4,374
  • 4
  • 35
  • 48

1 Answers1

0

According to this:

http://docs.mongodb.org/ecosystem/drivers/java-concurrency/#java-driver-concurrency

It looks like connections are pulled from an internal connection pool and returned "per request" so there is no database connection tied to a thread.

I haven't found a way to override this yet. Perhaps there is another driver out there, or a setting I haven't found yet.

Edit: Apparently I didn't read the article far enough. You should be able to use db.requestStart() to ensure the connection is keep for the thread.

There's a similar mention for C# and Python here:

http://docs.tokutek.com/tokumx/tokumx-transactions.html#tokumx-transactions-multi-statement-drivers