|
ORE Studio 0.0.4
|
Exception thrown when an optimistic locking version conflict occurs. More...
#include <version_conflict_exception.hpp>
Inherits exception, and exception.

Public Member Functions | |
| version_conflict_exception (std::string_view entity_type, std::string_view entity_id, int expected_version, int actual_version) | |
| Constructs a version conflict exception with detailed information. | |
| version_conflict_exception (std::string_view message="") | |
| Constructs a version conflict exception with a custom message. | |
| const char * | what () const noexcept override |
| const std::optional< std::string > & | entity_type () const noexcept |
| const std::optional< std::string > & | entity_id () const noexcept |
| std::optional< int > | expected_version () const noexcept |
| std::optional< int > | actual_version () const noexcept |
Exception thrown when an optimistic locking version conflict occurs.
This exception indicates that an entity update failed because the version provided by the client does not match the current version in the database. This typically happens when another client has modified the entity between the time it was read and the time the update was attempted.
| version_conflict_exception | ( | std::string_view | entity_type, |
| std::string_view | entity_id, | ||
| int | expected_version, | ||
| int | actual_version | ||
| ) |
Constructs a version conflict exception with detailed information.
| entity_type | The type of entity that had the version conflict |
| entity_id | The identifier of the entity |
| expected_version | The version the client expected (sent with update) |
| actual_version | The current version in the database |
|
explicit |
Constructs a version conflict exception with a custom message.
When using this constructor, entity_type, entity_id, expected_version, and actual_version will be std::nullopt, indicating that this detailed information is not available.