[CSHARP-627] Remove FireAndForget and use magic values for "w" instead Created: 08/Nov/12 Updated: 20/Mar/14 Resolved: 08/Nov/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.7 |
| Fix Version/s: | 1.7 |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Robert Stam | Assignee: | Robert Stam |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Major Change | ||||||||
| Description |
|
After we had already finished implementing support for FireAndForget it was decided that FireAndForget was not an acceptable keyword after all. Instead, we are to use certain magic values for "w" to imply whether write concern is enabled or not, as follows:
At a low level these values result in the following getLastError commands being sent to the server:
see: http://www.mongodb.org/display/DOCS/getLastError+Command Interaction with getLastErrorDefaultsA replica set can be configured with getLastErrorDefaults to be used when the driver sends a bare getLastError command with no arguments. See: http://docs.mongodb.org/manual/reference/replica-configuration/ You override getLastErrorDefaults by providing some arguments to the getLastError command. This is done in the C# driver by assigning values to one or more properties of the new WriteConcern object (or setting the equivalent options in the connection string). For example, to override the getLastErrorDefaults with w=3 and journal=true you could either use this connection string:
or this code:
Either way results in the following getLastError command being sent to the server:
A consequence of this design is that it is impossible to send the following getLastError command:
because w=1 is a magic value that means to send a bare getLastError command instead. The result of this limitation is that it is impossible to override getLastErrorDefaults with a value of { w : 1 }. |
| Comments |
| Comment by auto [ 20/Nov/12 ] |
|
Author: {u'date': u'2012-11-15T03:24:49Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: |
| Comment by auto [ 20/Nov/12 ] |
|
Author: {u'date': u'2012-11-11T23:04:42Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: |
| Comment by auto [ 16/Nov/12 ] |
|
Author: {u'date': u'2012-11-15T03:24:49Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by auto [ 16/Nov/12 ] |
|
Author: {u'date': u'2012-11-11T23:04:42Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |