PHPackages                             webonaute/doctrine-datalocking-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. webonaute/doctrine-datalocking-bundle

ActiveSymfony-bundle[Database &amp; ORM](/categories/database)

webonaute/doctrine-datalocking-bundle
=====================================

Lock a list of object of the same entity to be executed by a single processor. When the lock is aquire, the lock ID generated can be use by a processor to execute action on that locked list.

2.0(4y ago)220.3kMITPHPPHP &gt;=8.0CI failing

Since Jun 25Pushed 4y ago2 watchersCompare

[ Source](https://github.com/Webonaute/DoctrineDataLockingBundle)[ Packagist](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle)[ Docs](https://github.com/Webonaute/DoctrineDataLockingBundle)[ RSS](/packages/webonaute-doctrine-datalocking-bundle/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (6)Dependencies (13)Versions (9)Used By (0)

Doctrine DataLocking Bundle
===========================

[](#doctrine-datalocking-bundle)

[![Latest Stable Version](https://camo.githubusercontent.com/f9efda308f92e6e8dd7863408badbc887fa4ea6a47c8502bccf5dcf523d845f5/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6e617574652f646f637472696e652d646174616c6f636b696e672d62756e646c652f762f737461626c652e737667)](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle) [![Total Downloads](https://camo.githubusercontent.com/25450330ee0b46e422c1eee812306b6b2ec399a02bbbfa835e22d098e9e3a703/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6e617574652f646f637472696e652d646174616c6f636b696e672d62756e646c652f646f776e6c6f6164732e737667)](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle) [![Latest Unstable Version](https://camo.githubusercontent.com/d39f8993528ea827c93a1bc3c139f370b0a156f640bf294d109fb4dd1e17b22e/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6e617574652f646f637472696e652d646174616c6f636b696e672d62756e646c652f762f756e737461626c652e737667)](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle) [![License](https://camo.githubusercontent.com/16703a8817e0aae674f15d5c23f5494393ef7b37505fc8879f9c66ea1e7e1063/68747470733a2f2f706f7365722e707567782e6f72672f7765626f6e617574652f646f637472696e652d646174616c6f636b696e672d62756e646c652f6c6963656e73652e737667)](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle)

- [Doctrine DataLocking Bundle](#doctrine-datalocking-bundle)
    - [About](#about)
    - [Branches](#branches)
    - [Installation](#installation)
    - [Documentation](#documentation)
        - [Configure Entity](#configure-entity)
        - [Lock data who are due.](#lock-data-who-are-due)
        - [Get objects related to one lock ID.](#get-objects-related-to-one-lock-id)
        - [Unlock object after usage.](#unlock-object-after-usage)
        - [Consume object after usage with deleteLocked](#consume-object-after-usage-with-deletelocked)
    - [License](#license)

About
-----

[](#about)

Lock a list of object of the same entity to be executed by a single processor. When the lock is aquire, the lock ID generated can be use by a processor to execute action on that locked list.

Branches
--------

[](#branches)

- Use version `1.0-dev` for Symfony 4.0+. [![build status](https://camo.githubusercontent.com/28008fec73b3dcec34fa9d79382383e54b7a8d2610f1f44956e91faab63972d9/68747470733a2f2f7472617669732d63692e6f72672f7765626f6e617574652f446f637472696e65446174614c6f636b696e6742756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/webonaute/DoctrineDataLockingBundle)

Installation
------------

[](#installation)

This bundle is available via [composer](https://github.com/composer/composer), find it on [packagist](https://packagist.org/packages/webonaute/doctrine-datalocking-bundle).

Run : `composer require webonaute/doctrine-datalocking-bundle 1.0-dev`

Documentation
-------------

[](#documentation)

### Configure Entity

[](#configure-entity)

Add this snipped code to your entity.

```
    use Webonaute\DoctrineDataLockingBundle\Entity\ProcessLock;

    ...

    /**
     * @var ProcessLock
     *
     * @ORM\Embedded(class=ProcessLock::class)
     */
    private $processLock;

    ...

    public function __construct()
    {
        ...
        $this->processLock = new ProcessLock();
    }

    /**
     * @return ProcessLock
     */
    public function getProcessLock(): ProcessLock
    {
        return $this->processLock;
    }

```

### Lock data who are due.

[](#lock-data-who-are-due)

```
while (null !== $lockId = $dataLockerService->lock(Entity::class, 500, $extraWhere, $lockAt)) {
    $this->queue->push($lockId);
}

```

### Get objects related to one lock ID.

[](#get-objects-related-to-one-lock-id)

```
$lockedEntities = $dataLockerService->findLocked(Entity::class, $lockId);

```

### Unlock object after usage.

[](#unlock-object-after-usage)

This will simply unlock the object. To consume the entity object, use deleteLocked method.

```
$lockedEntities = $dataLockerService->unlock(Entity::class, $lockId);

```

### Consume object after usage with deleteLocked

[](#consume-object-after-usage-with-deletelocked)

This method will consume the entity object by deleting it from the database.

```
$lockedEntities = $dataLockerService->deleteLocked(Entity::class, $lockId);

```

License
-------

[](#license)

See [LICENSE](LICENSE).

###  Health Score

34

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 85.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~177 days

Recently: every ~97 days

Total

7

Last Release

1496d ago

Major Versions

1.1.2 → 2.02022-05-25

PHP version history (2 changes)1.0PHP &gt;=7.2

2.0PHP &gt;=8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/21aade44b58316841ba31de66ba2f3734fad35679a05c6a9d6f7aa2a296163d1?d=identicon)[Webonaute](/maintainers/Webonaute)

---

Top Contributors

[![Webonaute](https://avatars.githubusercontent.com/u/1700815?v=4)](https://github.com/Webonaute "Webonaute (6 commits)")[![ArtemBrovko](https://avatars.githubusercontent.com/u/2372366?v=4)](https://github.com/ArtemBrovko "ArtemBrovko (1 commits)")

---

Tags

symfonybundledatadatabaseperformancedoctrineprocessqueuelockinglocksymfony4

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/webonaute-doctrine-datalocking-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/webonaute-doctrine-datalocking-bundle/health.svg)](https://phpackages.com/packages/webonaute-doctrine-datalocking-bundle)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.5M378](/packages/easycorp-easyadmin-bundle)[rcsofttech/audit-trail-bundle

Enterprise-grade, high-performance Symfony audit trail bundle. Automatically track Doctrine entity changes with split-phase architecture, multiple transports (HTTP, Queue, Doctrine), and sensitive data masking.

1175.2k](/packages/rcsofttech-audit-trail-bundle)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.4M196](/packages/sulu-sulu)[2lenet/crudit-bundle

The easy like Crud'it Bundle.

1615.6k12](/packages/2lenet-crudit-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
