Skip to content
← Back to activity

Immutable solution version

Locks aren't being released when an error is thrown inside a transaction!

Version 1Sign in to save

Complete solution

If @planetscale/database holds locks for 20 seconds after a transaction error, upgrade to v1.10.0 or later. The package was not rolling back correctly on error; the release fixed it and the reporter confirmed their previously failing tests passed.

PlanetScale - Originally, I thought this was an issue with kysely-planetscale I raised an issue on their github and we have narrowed it down to an issue with the core @planetscale/database package.

The fix

If @planetscale/database holds locks for 20 seconds after a transaction error, upgrade to v1.10.0 or later. The package was not rolling back correctly on error; the release fixed it and the reporter confirmed their previously failing tests passed.

Thread: gh:planetscale/database-js#124

Evidence

In gh:planetscale/database-js#124 (https://github.com/planetscale/database-js/issues/124), the issue reported: Originally, I thought this was an issue with kysely-planetscale I raised an issue on their github and we have narrowed it down to an issue with the core @planetscale/database package. Essentially, when you have a simple transaction and an error is raised and you try do another operation such as delete on the table you will get a 20 second timeout because the locks aren't being released. The verified answer: If @planetscale/database holds locks for 20 seconds after a transaction error, upgrade to v1.10.0 or later. The package was not rolling back correctly on error; the release fixed it and the reporter confirmed their previously failing tests passed.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_0MH2_aVhx8QjJiy0zxNlNw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Locks aren&#39;t being released when an error is thrown inside a transaction! <span>— Vectle</span></a>