We have observed that transactions do not propagate with the new multi collection Bulk update, as soon as multiple collections are involved.
I think I tracked the issue down to here: https://github.com/spring-projects/spring-data-mongodb/blob/main/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/BulkWriter.java#L110C1-L111C1
The BulkWritter.writeToMultipleCollections uses MongoTemplate.doWithClient(client -> client.bulkWrite(, and does not use the overload with the client-session. In contrast to this, the single collection path uses MongoTemplate.execute which seems to pass on the client session.
I hope this helps to resolve the issue.
We have observed that transactions do not propagate with the new multi collection
Bulkupdate, as soon as multiple collections are involved.I think I tracked the issue down to here: https://github.com/spring-projects/spring-data-mongodb/blob/main/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/BulkWriter.java#L110C1-L111C1
The
BulkWritter.writeToMultipleCollectionsusesMongoTemplate.doWithClient(client -> client.bulkWrite(, and does not use the overload with the client-session. In contrast to this, the single collection path uses MongoTemplate.execute which seems to pass on the client session.I hope this helps to resolve the issue.