Is it possible to use transaction with web worker?
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 文件
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- javascript, sqlite
研究方向
The issue names no files, tests, or entry points. Start by reviewing how web-worker exec messages are handled and how SQLite transactions span asynchronous calls. Done would require a documented answer or a clearly scoped change, but the issue does not define which.
由索引模型根據 Issue 內容生成。
描述
I am just curious, will the transaction work as expected if I do this:
worker.postMessage({
id: 2,
action: "exec",
sql: "BEGIN TRANSACTION"
});
worker.postMessage({
id: 3,
action: "exec",
sql: "INSERT ...",
params: { "$id": 1 }
});
worker.postMessage({
id: 4,
action: "exec",
sql: "INSERT ...",
params: { "$id": 2 }
});
worker.postMessage({
id: 5,
action: "exec",
sql: "COMMIT"
});
How can I be sure, that only id 3, 4 will be committed in the current transaction? I mean, after the transaction started I can't guarantee that other async codes could be executed that could not relate to the current transaction(for example, when setTimeout happens). Is there something like the ID of the transaction, under which other queries should be executed?
- 主要語言
- JavaScript
- 星號
- 13.7k
- 分支
- 1.1k
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
sql-js/sql.js 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 48/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 2/5 1-3 小時 新手友好度 45/100
-
難度 4/5 3-5 天 新手友好度 35/100
-
難度 4/5 3-5 天 新手友好度 35/100
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
難度 2/5 1-3 小時 新手友好度 76/100
-
難度 2/5 1-3 小時 新手友好度 78/100
Automattic/studio#4908 ·
-
難度 2/5 1-3 小時 新手友好度 74/100
-
難度 2/5 1-3 小時 新手友好度 86/100
sugarlabs/musicblocks#8847 ·