Skip to content

Commit 9baadec

Browse files
committed
PYTHON-1729 Add read preference to transaction retry example
1 parent 2b57cbb commit 9baadec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/test_examples.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,8 @@ def update_employee_info(session):
10101010

10111011
with session.start_transaction(
10121012
read_concern=ReadConcern("snapshot"),
1013-
write_concern=WriteConcern(w="majority")):
1013+
write_concern=WriteConcern(w="majority"),
1014+
read_preference=ReadPreference.PRIMARY):
10141015
employees_coll.update_one(
10151016
{"employee": 3}, {"$set": {"status": "Inactive"}},
10161017
session=session)

0 commit comments

Comments
 (0)