Joedb 9.1.4
The Journal-Only Embedded Database
|
Lock object that allows writing to a database managed by a joedb::Client. More...
#include <joedb/concurrency/Client.h>
Public Member Functions | |
Client_Lock (Client &client) | |
Client_Lock (const Client_Lock &)=delete | |
Client_Lock & | operator= (const Client_Lock &)=delete |
void | push () |
Checkpoint current journal, and push to the connection. | |
void | push_unlock () |
Confirm the transaction right before lock destruction. | |
void | unlock () |
Cancel the transaction right before lock destruction. | |
~Client_Lock () | |
Protected Member Functions | |
bool | is_locked () const |
Protected Attributes | |
Client & | client |
Journal_Lock | journal_lock |
At the end of the life of this object, right before destruction, you should call either unlock to cancel the transaction, or push_unlock to confirm it. If you fail to do so, the destructor will call unlock. But calling unlock explicitly is better if possible, because it can throw exceptions, unlike the destructor.
|
delete |
|
inlineprotected |
|
delete |
|
inline |
Unlike push_unlock, you can call this function multiple times during the life of the lock.
|
inline |
|
inline |
|
protected |