You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: Resources/doc/entity_manager.md
+3-13
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
**DoctrineSolrBundle** provides an entity manager (**\Mdiyakov\DoctrineSolrBundle\Manager\EntityManager**) to handle the case when an exception was triggered during flushing entity in database.
4
4
5
-
During flushing an entity in database there is probability the exception will be thrown after the changes were successfully saved in solr. It can be caused by other entity listeners or something issues with database. In this case inconsistency can be broken beetwen database and solr because in database the changes will be rollback but in solr will be kept.
5
+
During flushing an entity in database there is probability the exception will be thrown after the changes were successfully saved in solr. It can be caused by other entity listeners or something issues with database. In this case consistency can be broken beetwen database and solr because in database the changes will be rollback but in solr will be kept.
6
6
7
7
To rollback the changes in solr in this case you can use the following approach:
8
8
@@ -14,18 +14,8 @@ $myEntity = new MyEntity();
14
14
15
15
$dsEm ->flush($myEntity);
16
16
```
17
-
In this case if any exception will be thrown in entity listener chain for example the solr changes also will be rollback.
17
+
In this case if any exception will be thrown (for example in entity listener chain) the solr changes also will be rollback.
18
18
19
-
You can use it with a few entities:
20
-
```
21
-
$dsEm = $this->get('ds.entity_manager');
22
-
$myEntity = new MyEntity();
23
-
$mySecondEntity = new MySecondEntity();
24
-
...
25
-
26
-
$dsEm ->flush([$myEntity,$mySecondEntity]);
27
-
28
-
```
29
19
30
-
> Pay attention 'ds.entity_manager' doesn't have interface like \Doctrine\ORM\EntityManager. It has only "flush"" method with mandatory argument
20
+
> Pay attention 'ds.entity_manager' doesn't have interface like \Doctrine\ORM\EntityManager. It has only "flush"" method with mandatory argument.
0 commit comments