Storage Engine API
mongo::WriteConflictException Class Referencefinal

This is thrown if during a write, two or more operations conflict with each other. More...

#include <write_conflict_exception.h>

Inheritance diagram for mongo::WriteConflictException:

Detailed Description

This is thrown if during a write, two or more operations conflict with each other.

For example if two operations get the same version of a document, and then both try to modify that document, this exception will get thrown by one of them.

Public Member Functions

 WriteConflictException ()
 

Static Public Member Functions

static void logAndBackoff (int attempt, StringData operation, StringData ns)
 Will log a message if sensible and will do an exponential backoff to make sure we don't hammer the same doc over and over. More...
 

Static Public Attributes

static AtomicBool trace
 If true, will call printStackTrace on every WriteConflictException created. More...
 

Private Member Functions

void defineOnlyInFinalSubclassToPreventSlicing () final
 

Constructor & Destructor Documentation

◆ WriteConflictException()

mongo::WriteConflictException::WriteConflictException ( )

Member Function Documentation

◆ defineOnlyInFinalSubclassToPreventSlicing()

void mongo::WriteConflictException::defineOnlyInFinalSubclassToPreventSlicing ( )
inlinefinalprivate

◆ logAndBackoff()

void mongo::WriteConflictException::logAndBackoff ( int  attempt,
StringData  operation,
StringData  ns 
)
static

Will log a message if sensible and will do an exponential backoff to make sure we don't hammer the same doc over and over.

Parameters
attempt- what attempt is this, 1 based
operation- e.g. "update"

Member Data Documentation

◆ trace

AtomicBool mongo::WriteConflictException::trace
static

If true, will call printStackTrace on every WriteConflictException created.

Can be set via setParameter named traceWriteConflictExceptions.


The documentation for this class was generated from the following files: