Commit 70d0e90
committed
BUGFIX: Prevent premature connection to database in
For every simple GET request `persistAllowedObjects` is called via the Package.php in flow.
This results in building a db connection, even if there is nothing to do.
We first check if the `entityManager` is open and if the entity manager has not been used (something is heavily cached via middle-ware or sth) flows objectmanagement retrieves the entity manger.
Now in this retrieval process - even though doctrines connection is lazy itself - the connection will be made forcefully
see `\Neos\Flow\Persistence\Doctrine\EntityManagerFactory::create` line 120 (https://github.com/neos/flow-development-collection/blob/11e2348125dd8286ff9ccc088e5d187dc9143bf5/Neos.Flow/Classes/Persistence/Doctrine/EntityManagerFactory.php#L120) or https://github.com/neos/flow-development-collection/blob/d93b6b09ca2071c87812a9ef4bc120201c44608a/Neos.Flow/Classes/Persistence/Doctrine/EntityManagerConfiguration.php#L229
This is ironic because if there is no connection - or no entity manager in the first place, the current process cannot have made any changes to the transaction.PersistenceManager::persistAllowedObjects
1 parent c4d1b64 commit 70d0e90
File tree
1 file changed
+6
-1
lines changed- Neos.Flow/Classes/Persistence/Doctrine
1 file changed
+6
-1
lines changedLines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
120 | 125 | | |
121 | 126 | | |
122 | 127 | | |
| |||
0 commit comments