Skip to content

Commit caa40b6

Browse files
committed
JAVA-2250: Remove references to the getlasterror command in Javadoc, replacing with generic reference to write commands
1 parent ef25738 commit caa40b6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

driver-core/src/main/com/mongodb/ConnectionString.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@
106106
* <ul>
107107
* <li>{@code safe=true|false}
108108
* <ul>
109-
* <li>{@code true}: the driver sends a getLastError command after every update to ensure that the update succeeded
109+
* <li>{@code true}: the driver ensures that all writes are acknowledged by the MongoDB server, or else throws an exception.
110110
* (see also {@code w} and {@code wtimeoutMS}).</li>
111-
* <li>{@code false}: the driver does not send a getLastError command after every update.</li>
111+
* <li>{@code false}: the driver does not ensure that all writes are acknowledged by the MongoDB server.</li>
112112
* </ul>
113113
* </li>
114114
* <li>{@code journal=true|false}
@@ -119,14 +119,14 @@
119119
* </li>
120120
* <li>{@code w=wValue}
121121
* <ul>
122-
* <li>The driver adds { w : wValue } to the getLastError command. Implies {@code safe=true}.</li>
122+
* <li>The driver adds { w : wValue } to all write commands. Implies {@code safe=true}.</li>
123123
* <li>wValue is typically a number, but can be any string in order to allow for specifications like
124124
* {@code "majority"}</li>
125125
* </ul>
126126
* </li>
127127
* <li>{@code wtimeoutMS=ms}
128128
* <ul>
129-
* <li>The driver adds { wtimeout : ms } to the getlasterror command. Implies {@code safe=true}.</li>
129+
* <li>The driver adds { wtimeout : ms } to all write commands. Implies {@code safe=true}.</li>
130130
* <li>Used in combination with {@code w}</li>
131131
* </ul>
132132
* </li>

driver-core/src/main/com/mongodb/WriteConcern.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ public boolean fsync() {
426426
}
427427

428428
/**
429-
* Returns whether "getlasterror" should be called (w &gt; 0)
429+
* Returns true if this write concern indicates that write operations must be acknowledged.
430430
*
431431
* @return whether this write concern will result in an an acknowledged write
432432
* @deprecated Prefer {@link #isAcknowledged()}

driver-core/src/main/com/mongodb/WriteConcernException.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public WriteConcernException(final BsonDocument response, final ServerAddress ad
5050
}
5151

5252
/**
53-
* For internal use only: extract the error code from the response to a getlasterror command.
53+
* For internal use only: extract the error code from the response to a write command.
5454
* @param response the response
5555
* @return the code, or -1 if there is none
5656
*/
@@ -63,7 +63,7 @@ public static int extractErrorCode(final BsonDocument response) {
6363
}
6464
}
6565

66-
// mongos may return a list of documents representing getlasterror responses from each shard. Return the one with a matching
66+
// mongos may return a list of documents representing write command responses from each shard. Return the one with a matching
6767
// "err" field, so that it can be used to get the error code
6868
if (!response.containsKey("code") && response.containsKey("errObjects")) {
6969
for (BsonValue curErrorDocument : response.getArray("errObjects")) {
@@ -76,7 +76,7 @@ public static int extractErrorCode(final BsonDocument response) {
7676
}
7777

7878
/**
79-
* For internal use only: extract the error message from the response to a getlasterror command.
79+
* For internal use only: extract the error message from the response to a write command.
8080
*
8181
* @param response the response
8282
* @return the error message

driver/src/main/com/mongodb/MongoClientURI.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@
8484
* <ul>
8585
* <li>{@code safe=true|false}
8686
* <ul>
87-
* <li>{@code true}: the driver sends a getLastError command after every update to ensure that the update succeeded
87+
* <li>{@code true}: the driver ensures that all writes are acknowledged by the MongoDB server, or else throws an exception.
8888
* (see also {@code w} and {@code wtimeoutMS}).</li>
89-
* <li>{@code false}: the driver does not send a getLastError command after every update.</li>
89+
* <li>{@code false}: the driver does not ensure that all writes are acknowledged by the MongoDB server.</li>
9090
* </ul>
9191
* </li>
9292
* <li>{@code journal=true|false}
@@ -97,14 +97,14 @@
9797
* </li>
9898
* <li>{@code w=wValue}
9999
* <ul>
100-
* <li>The driver adds { w : wValue } to the getLastError command. Implies {@code safe=true}.</li>
100+
* <li>The driver adds { w : wValue } to all write commands. Implies {@code safe=true}.</li>
101101
* <li>wValue is typically a number, but can be any string in order to allow for specifications like
102102
* {@code "majority"}</li>
103103
* </ul>
104104
* </li>
105105
* <li>{@code wtimeoutMS=ms}
106106
* <ul>
107-
* <li>The driver adds { wtimeout : ms } to the getlasterror command. Implies {@code safe=true}.</li>
107+
* <li>The driver adds { wtimeout : ms } to all write commands. Implies {@code safe=true}.</li>
108108
* <li>Used in combination with {@code w}</li>
109109
* </ul>
110110
* </li>

0 commit comments

Comments
 (0)