Skip to content

Commit 2f936cf

Browse files
CSHARP-2492: Update Transactions Retry Example 3 to include read preference.
1 parent e7f097b commit 2f936cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/MongoDB.Driver.Examples/TransactionExamplesForDocs/RetryExample3.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ public void UpdateEmployeeInfo(IMongoClient client, IClientSessionHandle session
8181

8282
session.StartTransaction(new TransactionOptions(
8383
readConcern: ReadConcern.Snapshot,
84-
writeConcern: WriteConcern.WMajority));
84+
writeConcern: WriteConcern.WMajority,
85+
readPreference: ReadPreference.Primary));
8586

8687
try
8788
{

0 commit comments

Comments
 (0)