RSS Feed/News AbstractAdapter::executeTransaction() leaves the transaction open after a TypeError

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
34,790
Points
823

Reputation:

If the callback passed to XF\Db\AbstractAdapter::executeTransaction() throws a TypeError, the error propagates and the transaction stays open. In a nested call, the helper leaves its savepoint on the stack, so the caller’s next rollback() rolls back to that savepoint and leaves the outer transaction open.

Suggested fix: catching \Throwable in the general rollback handler so executeTransaction() cleans up when a callback throws a PHP error such as TypeError

Continue reading...
 
Status
Not open for further replies.
Top