关键代码const tx = db.transaction(['items'], 'readwrite')

const store = tx.objectStore('items')

try {

for (const it of batch) store.put(it)

await tx.done

} catch (e) {

tx.abort()

}

验证与参数指标:事务耗时、失败率、回滚成功率注意事项避免长事务与锁等待;分批提交与进度显示

点赞(0) 打赏

评论列表 共有 0 条评论

暂无评论
立即
投稿

微信公众账号

微信扫一扫加关注

发表
评论
返回
顶部