Skip to content

Record locking

Lock

Lock is an internal FalconDB object, which supports correct multithreading. When the database record is locked, it means that it cannot be changed by any other thread in FalconDB.

Usage

To obtain a lock on a record, simply set the lock URL parameter to true in a record related request (See FalconDB API). For example http://localhost:8021/_by_name/falcon-db-core-microservice/v1/readObject?table-name=example-table&key=example-record-key&lock=true.

Barrier

Barrier is a FalconDB object, which supports multithreading from outside of the FalconDB (another application). When another application (barrier's owner) needs to perform a complex operation (which includes using FalconDB), it simply puts a barrier on an object(s), which needs to be immutable (for others) during the execution of an operation. Barrier contains a timeout parameter, which defines the time after which the barrier is automatically released. This implementation allows to execute secure operations - when the application executing operation encounters an error and does not release the barrier it is done automatically (after timeout has occured), so the record can be accessed again (otherwise it would be forever unaccessible). Barrier approach can also ensure that the complex operation will be executed on solely one FalconDB node and not on multiple at the same time.

Usage

For barrier usage details, visit FalconDB API's barrier section.