Public Member Functions

Wt::Dbo::StaleObjectException Class Reference
[Database Objects (Dbo)]

Exception thrown when Wt::Dbo detects a concurrent modification More...

#include <Wt/Dbo/Exception>

Inheritance diagram for Wt::Dbo::StaleObjectException:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 StaleObjectException (const std::string &id, int version)
 Constructor.

Detailed Description

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.

Note:
We should perhaps also have a ptr::isStale() method to find out what database object is stale ?
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator

Generated on Fri Feb 4 2011 for the C++ Web Toolkit (Wt) by doxygen 1.7.2