[CSHARP-614] Change default WriteConcern behavior to acknowledge writes Created: 27/Oct/12 Updated: 20/Mar/14 Resolved: 08/Nov/12 |
|
| Status: | Closed |
| Project: | C# Driver |
| Component/s: | None |
| Affects Version/s: | 1.6.1 |
| Fix Version/s: | 1.7 |
| Type: | Improvement | 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 |
|
This JIRA was edited to remove mention of the FireAndForget keyword. See also In the past the default WriteConcern for all drivers has been to not acknowledge writes. In the future this will no longer be the default WriteConcern, and the default behavior will be for drivers to send a simple { getlasterror : 1 }command after every insert/update operation. Additional arguments to the getLastError command can be configured using WriteConcern properties. Because existing code may depend on the previous default, we are introducing a new root object (called MongoClient). When you use the new root object, acknowledging writes will be the new default. Of course, if your connection string includes any WriteConcern related settings they will override the default (regardless of what the default is). Currently, C# applications begin using MongoDB like this:
In the future, the correct way to begin using MongoDB is:
If you don't plan to call any methods from MongoServer (usually you won't) you can navigate directly from the client object to a database object:
Except for replacing the call to MongoServer.Create with instantiating a MongoClient and calling GetServer, from then on your application will continue to use the existing API unchanged (although see the related JIRA where we are replacing SafeMode with WriteConcern). The existing MongoServer.Create methods will continue to exist for a few releases, but they are being marked Obsolete to generate warnings to remind you to use MongoClient instead. Therefore this change is slightly backward breaking in the short term (because warnings are introduced) and backward breaking in the long term since the MongoServer.Create methods will eventually be removed. |
| Comments |
| Comment by auto [ 10/Dec/12 ] |
|
Author: {u'date': u'2012-11-20T04:16:56Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: |
| Comment by auto [ 26/Nov/12 ] |
|
Author: {u'date': u'2012-11-20T04:16:56Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by auto [ 06/Nov/12 ] |
|
Author: {u'date': u'2012-11-02T15:48:16Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: |
| Comment by auto [ 06/Nov/12 ] |
|
Author: {u'date': u'2012-10-28T17:02:29Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: Conflicts: |
| Comment by auto [ 06/Nov/12 ] |
|
Author: {u'date': u'2012-11-02T15:48:16Z', u'email': u'robert@10gen.com', u'name': u'rstam'}Message: |
| Comment by auto [ 29/Oct/12 ] |
|
Author: {u'date': u'2012-10-28T10:02:29-07:00', u'name': u'rstam', u'email': u'robert@10gen.com'}Message: |