MARKETPLACE
PLUGINS
DATABASE LOCK
Database Lock logo

Database Lock

Published July 2021
   •    Updated December 2025

Plugin details

Acquire locks to read from / write to the database in order to avoid concurrency issues and race conditions.
Bubble suffers from concurrency issues (two workflows could potentially read/write the same piece of data in the database). Using this plugin will allow you to acquire a lock, so other workflows trying to acquire the same lock will not be allowed to, until the lock is released.

Think of locks as a semaphore. Process A acquires a lock and then starts doing its work. If process B wants to acquire the same lock, and it's not been released by process A, it will fail so it will have to wait until the lock is released by process A (or expires).

$5

Per month

No ratings yet
10 installs  
This plugin does not collect or track your personal data.

Platform

Web & Native mobile

Contributor details

Miguel G logo
Miguel G
Joined 2020   •   3 Plugins
View contributor profile

Instructions

Acquire lock -----------------

If a workflow wants to acquire a lock, use the 'Acquire lock' action, and fill in the following parameters:

- Lock id: The name of the lock to acquire. Other workflows reading from / writing to the same piece of data in the database should use the same Lock id.

- Client id: An identifier for the user/process acquiring the lock. Only the user/workflow with the same Client id as the one used to acquire the lock will be able to release it.

- Time to live: The duration of the lock, in seconds (defaults to 10 seconds). The creator of the lock will be able to release the lock before its expiration, but if the creator doesn't release it, the lock will expire after this time.

- Website home URL: Enter the Website home URL.


Release lock
------------------

If a workflow wants to release a lock it had previously acquired, use the 'Release lock' action, and fill in the following parameters:

- Lock id: The name of the lock to release.

- Client id: The name of the user/process that had acquired the lock. Only the client that acquired it is able to release it.

- Website home URL: Enter the Website home URL.




Editor: https://bubble.io/page?type=page&name=database_lock&id=magc-demos&test_plugin=1626966832899x409936294626197500_current

Demo: https://magc-demos.bubbleapps.io/version-test/database_lock

Types

This plugin can be found under the following types:

Categories

This plugin can be found under the following categories:

Resources

Support contact
Tutorial

Rating and reviews

Average rating (0.0)

Broken. Requires update
July 10th, 2025
lastest version, 1.1.1 cannot release a lock. The release action relies on bubble.io's "context.async", which is deprecated and moved to context.v3.async. Even if this did work as advertised, it is unusably slow in obtaining a DB lock.
Bubble