Wt
4.11.1
|
Exception thrown when Wt::Dbo detects a concurrent modification More...
#include <Wt/Dbo/Exception.h>
Public Member Functions | |
StaleObjectException (const std::string &id, const char *table, int version) | |
Constructor. | |
Public Member Functions inherited from Wt::Dbo::Exception | |
Exception (const std::string &error, const std::string &code=std::string()) | |
Constructor. | |
std::string | code () const |
A (backend-specific) error code. More... | |
Exception thrown when Wt::Dbo detects a concurrent modification
Wt::Dbo uses optimistic locking for detecting and preventing concurrent modification of database objects. When trying to save an object that has been modified concurrently by another session, since it was read from the database, this exception is thrown.
This exception is thrown during flushing from Session::flush() or ptr::flush(). Since flushing will also be done automatically when needed (e.g. before running a query or before committing a transaction), you should be prepared to catch this exception from most library API calls.