Mongo.Session (Mongodb v1.0.0) View Source
Link to this section Summary
Functions
Abort current transaction and rollback changes introduced by it. It will error if the session is invalid.
Commit current transaction. It will error if the session is in invalid state.
Finish current session and rollback uncommited transactions if any.
Check whether given session has already ended.
Start new transaction within current session.
Run provided func
within transaction and automatically commit it if there
was no exceptions.
Link to this section Types
Specs
session()
Link to this section Functions
Specs
Abort current transaction and rollback changes introduced by it. It will error if the session is invalid.
Specs
Commit current transaction. It will error if the session is in invalid state.
Specs
end_session(session()) :: :ok
Finish current session and rollback uncommited transactions if any.
WARNING: Session is ended in asynchronous manner, which mean, that
the process itself can be still available and Mongo.Session.ended?(session)
can still return false
for some time after calling this function.
Specs
Check whether given session has already ended.
Specs
Start new transaction within current session.
Specs
with_transaction(session(), keyword(), (() -> return)) :: {:ok, return} | {:error, term()} when return: term()
Run provided func
within transaction and automatically commit it if there
was no exceptions.