Mongo.Session.ServerSession (mongodb-driver v1.4.0) View Source
This module represents the server-side session. There are three fields:
last_use
- The timestamp for the last use of this server sessiontxn_num
- The current transaction numbersession_id
- The session id of this server session
When a transaction is active, all operations in that transaction use the same transaction number.
Transaction number is also used outside of transactions for retryable writes. In this case, each write operation has its own transaction number, but retries of a write operation use the same transaction number as the first write (which is how the server knows that subsequent writes are retries and should be ignored if the first write succeeded on the server but was not read by the client, for example).
Link to this section Summary
Functions
Return true, if the server session will time out. In this case the session can be removed from the queue.
Create a new server session.
Increment the current transaction number and return the new value.
Update the last_use attribute of the server session to now.
Link to this section Types
Specs
t() :: %Mongo.Session.ServerSession{ last_use: integer(), session_id: BSON.Binary.t(), txn_num: non_neg_integer() }
Link to this section Functions
Specs
Return true, if the server session will time out. In this case the session can be removed from the queue.
Specs
new() :: t()
Create a new server session.
Specs
Increment the current transaction number and return the new value.
Specs
Update the last_use attribute of the server session to now.