Skip to content

Commit 9093155

Browse files
Revert "DRIVERS-2782 Allow variable access to snapshotTimeout (mongodb#1870)"
This reverts commit 0bc7fb6.
1 parent 0bc7fb6 commit 9093155

File tree

2 files changed

+2
-14
lines changed

2 files changed

+2
-14
lines changed

source/sessions/snapshot-sessions.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ class ClientSession {
137137
}
138138
```
139139

140-
The `snapshotTime` field MUST be read-only; in APIs that expose `snapshotTime` with a getter, attempting to read it on a
141-
non-snapshot session MUST raise an error.
140+
Getting the value of `snapshotTime` on a non-snapshot session MUST raise an error.
142141

143142
Transactions are not allowed with snapshot sessions. Calling `session.startTransaction(options)` on a snapshot session
144143
MUST raise an error.
@@ -271,7 +270,6 @@ C# driver will provide the reference implementation. The corresponding ticket is
271270

272271
## Changelog
273272

274-
- 2025-12-17: Clarify snapshotTime semantics: the field is either read-only or validated.
275273
- 2025-09-23: Exposed snapshotTime to applications.
276274
- 2024-05-08: Migrated from reStructuredText to Markdown.
277275
- 2021-06-15: Initial version.

source/sessions/tests/README.md

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -270,20 +270,10 @@ Snapshot sessions tests require server of version 5.0 or higher and replica set
270270

271271
Snapshot sessions tests require server of version 5.0 or higher and replica set or a sharded cluster deployment.
272272

273-
- Start a session by calling `startSession` with `snapshot = false`.
274-
275-
Drivers SHOULD implement one of the following approaches:
276-
277-
**Approach 1: Validation (preferred if idiomatic)**
278-
273+
- Start a session by calling `startSession` on with `snapshot = false`.
279274
- Try to access the session's snapshot time.
280275
- Assert that a client side error was raised.
281276

282-
**Approach 2: Ensure Read-Only (if error-returning getters are not idiomatic)**
283-
284-
- Attempt to mutate the session's `snapshotTime` field through any publicly accessible API.
285-
- Assert that the original session's `snapshotTime` remains unchanged.
286-
287277
## Changelog
288278

289279
- 2025-09-25: Added tests for snapshotTime.

0 commit comments

Comments
 (0)