Skip to content

Commit 940b8ac

Browse files
committed
fix(uncommited db transaction) FsEventMapper::insertRow() must not return from within an active transaction.
Why: the database connection is shared between all the code of the PHP script life-time. Opening another transaction from within an transaction is ok, but not committing that transaction is not ok as this will finally lead to a state where the script exits with positive transaction nesting level. This has the effect that ALL database mutations performed by ALL other modules (and also by the context_chat) module will just be discarded. Thus, if any app does not properly commit all transaction frames it has started then "evil things" will happen ;) Signed-off-by: Claus-Justus Heine <[email protected]>
1 parent 7526d00 commit 940b8ac

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/Db/FsEventMapper.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public function insertRow(string $type, string $userId, int $nodeId): Entity {
4848
$entities = $this->findEntities($qb);
4949

5050
if (!empty($entities)) {
51+
$this->db->commit();
5152
return $entities[0];
5253
}
5354

0 commit comments

Comments
 (0)