Skip to content

Commit

Permalink
Merge branch 'DRIVERS-2789-sessions' of github.com:blink1073/specific…
Browse files Browse the repository at this point in the history
…ations into DRIVERS-2789-sessions
  • Loading branch information
blink1073 committed May 10, 2024
2 parents 52cc7ab + 82fda4d commit e768283
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions source/sessions/driver-sessions.md
Original file line number Diff line number Diff line change
Expand Up @@ -826,7 +826,6 @@ checking this would require overhead that doesn't provide any clear benefit.

A previous draft proposed that ClientSession would be a MongoClient-like object added to the object hierarchy:

````
```javascript
session = client.startSession(...)
database = session.getDatabase(...) // database is associated with session
Expand All @@ -835,7 +834,6 @@ collection = database.getCollection(...) // collection is associated with sessio
collection.insertOne({})
session.endSession()
```
````

The central feature of this design is that a MongoCollection (or database, or perhaps a GridFS object) is associated
with a session, which is then an implied parameter to any operations executed using that MongoCollection.
Expand All @@ -848,7 +846,6 @@ parent MongoDatabase is created.

Instead, we require users to pass session as a parameter to each function:

````
```javascript
session = client.startSession(...)
database = client.getDatabase(...)
Expand All @@ -857,7 +854,6 @@ collection = database.getCollection(...)
collection.insertOne(session, {})
session.endSession()
```
````

### Why does a network error cause the `ServerSession` to be discarded from the pool?

Expand Down

0 comments on commit e768283

Please sign in to comment.