Symfony Doctrine Concurrency

I used Optimistic-Locking here you can find the documentation:

http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/transactions-and-concurrency.html

You can add in your entity the field version. Automatically doctrine will manage concurrency throwing an Exceprion.

use Doctrine\ORM\Mapping as ORM;

... 

 /**
 * @var int
 *
 * @ORM\Column(name="version", type="integer", nullable=true)
 * @ORM\Version
 */
 private $version;
This entry was posted in Symfony and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s