-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Updates to work with the 3.0.x branch of the Java driver #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ding method has been removed from the 3.0 driver
…been removed from the 3.0 driver
…hich has been deprecated.
…s been removed from the 3.0 driver
…er no longer adds that field to the raw results.
…n removed from the 3.0 driver
…replacing them with the ones that they currently extend.
…n removed from the 3.0 driver
…that has been removed from the 3.0 driver
…om the 3.0 driver, and deprecated MongoTemplate.executeInSession
…en removed in the 3.0 driver. Replaced with use of DB.command method that takes a ReadPreference, and added a new public method to MongoTemplate to match.
…, which has been removed from the 3.0 driver. This needs to be addresses, as it's a silently breaking change.
…teResultErrors method. The reason is that if there was a write error, the driver would not have returned a WriteResult: it would have thrown an exception. A WriteResult would only be returned for a failed write if the WriteConcern was unacknowledged, in which case a call to WriteResult.getError is not the right thing to do, as it's forcing the write to be acknowledged, which essentially ignores the write concern.
… been removed from the 3.0 driver, and changed MongoTemplate.mapReduce to use DBCollection.mapReduce instead of DB.command. This introduces a few minor issues: 1. MapReduceOptions.extraOptions is silently ignored 2. MapReduceResults.timing property is no longer correct 3. The raw mapReduce command is no longer logged
…e the fsync property of the WriteConcern.
Also wanted to note that this branch has some test failures that will be resolved once the next 3.0.0-SNAPSHOT is pushed to Sonatype. Just need to get past some build failures on our CI server, but hopefully by the end of the day it will be up. |
Thanks @jyemin we've opend DATAMONGO-1158 for this one and are actively looking into it. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There are a few failing tests, but this is pretty close to working. Please see individual commits for specific issues.
The biggest remaining problem relates to checking the results of a write. From what I can see MongoTemplate currently forces the acknowledgement of every write, regardless of the write concern in play. This is due to the explicit call by MongoTemplate to WriteResult.getError() (which have been deprecated in 2.13 and removed in 3.0) after each write, and also by the call to WriteResult.getN() after each update.
Given that current behavior, one option is to instead force acknowledgment by using WriteConcern.ACKNOWLEDGED as the minimum write concern. Doing this lets the driver apply the write concern at the same time as the write, which is the only option you have in 3.0 and more efficient in 2.x as well.
I realize now that I didn't fully follow the contributing guidelines. I will fix that and rebase if this looks like something that you'll eventually accept.