My team has encountered a problem while moving from regular MongoDB server to AWS DocumentDB.
Basically DocumentDB does not support cursors in transactions which is kinda a problem for us.
It results in exception when finding more than 102 documents from collection within transaction. I don't know why it's exactly 102 but it happens to be number of documents which causes an issue for me, anything less than that works just fine, and anything more than that results in
org.springframework.data.mongodb.UncategorizedMongoDbException: Query failed with error code 303 and error message 'Feature not supported: cursor within transaction. Try increasing the batchsize.'
Any idea how to resolve this issue? The first thing that came to my mind was not finding documents within transactions but I'd rather leave it as the last option.
Here are the files where you can reproduce it:
MongoTransactionApplication.java
edit: forgot to mention this initially but Mongo and DocumentDB servers are both version 4.0