@@ -507,11 +507,11 @@ The DoctrineDbalStore saves locks in an SQL database. It is identical to PdoStor
507
507
but requires a `Doctrine DBAL Connection `_, or a `Doctrine DBAL URL `_. This store
508
508
does not support blocking, and expects a TTL to avoid stalled locks::
509
509
510
- use Symfony\Component\Lock\Store\PdoStore ;
510
+ use Symfony\Component\Lock\Store\DoctrineDbalStore ;
511
511
512
- // a PDO, a Doctrine DBAL connection or DSN for lazy connecting through PDO
512
+ // a Doctrine DBAL connection or DSN
513
513
$connectionOrURL = 'mysql://myuser:[email protected] /app';
514
- $store = new PdoStore ($connectionOrURL);
514
+ $store = new DoctrineDbalStore ($connectionOrURL);
515
515
516
516
.. note ::
517
517
@@ -566,11 +566,11 @@ The DoctrineDbalPostgreSqlStore uses `Advisory Locks`_ provided by PostgreSQL.
566
566
It is identical to PostgreSqlStore but requires a `Doctrine DBAL Connection `_ or
567
567
a `Doctrine DBAL URL `_. It supports native blocking, as well as sharing locks::
568
568
569
- use Symfony\Component\Lock\Store\PostgreSqlStore ;
569
+ use Symfony\Component\Lock\Store\DoctrineDbalPostgreSqlStore ;
570
570
571
- // a PDO instance or DSN for lazy connecting through PDO
572
- $databaseConnectionOrDSN = 'pgsql:host=localhost;port= 5634;dbname= lock';
573
- $store = new PostgreSqlStore ($databaseConnectionOrDSN, ['db_username' => 'myuser', 'db_password' => 'mypassword'] );
571
+ // a Doctrine Connection or DSN
572
+ $databaseConnectionOrDSN = 'postgresql+advisory://myuser:[email protected] : 5634/ lock';
573
+ $store = new DoctrineDbalPostgreSqlStore ($databaseConnectionOrDSN);
574
574
575
575
In opposite to the ``DoctrineDbalStore ``, the ``DoctrineDbalPostgreSqlStore `` does not need a table to
576
576
store locks and does not expire.
0 commit comments