Skip to content

Conversation

@PadmaPreethi
Copy link

Hi,

I noticed a bug in one of the MongoTemplate constructor while assigning the MappingMongoConverter. Here is the scenario to reproduce,

Create a MongoTemplate with ClientSession, internally it calls the mongotemplate and checks whether it has a valid MappingMongoConverter. If it's valid, it should set that, else create a default MongoConverter. But the condition is viceversa. I have raised a PR to fix this. Please check.

@pivotal-issuemaster
Copy link

@PadmaPreethi Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

@pivotal-issuemaster
Copy link

@PadmaPreethi Thank you for signing the Contributor License Agreement!

@PadmaPreethi
Copy link
Author

@christophstrobl : Can you please provide feedback on this pull request ?

Thanks!

@christophstrobl
Copy link
Member

Inverting the condition causes DBRef resolution to happen outside the session. There's SessionBoundMongoTemplateTests checking the behavior. Please make sure all tests pass when opening a PR and check Travis CI builds for failures. Thank you!
We're already investigating options to preserve potentially registered custom Converter. Please join the discussion on DATAMONGO-2183 there.

@PadmaPreethi
Copy link
Author

Thanks @christophstrobl for the feedback. As suggested in the DATAMONGO-2183 , we are using (Document) converter.convertToMongoType(pojo)) and using the MongoClient with session for updates. By that way both converter and the session works together.

@mp911de
Copy link
Member

mp911de commented Apr 9, 2019

This issue was fixed with DATAMONGO-2241.

@mp911de mp911de closed this Apr 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants