未验证 提交 246a8c7e 编写于 作者: O openharmony_ci 提交者: Gitee

!7829 更新事务相关例程 beginTransaction、commit、rollBack

Merge pull request !7829 from PaDaBoo/master
......@@ -1638,13 +1638,7 @@ const valueBucket = {
"salary": 100.5,
"blobType": new Uint8Array([1, 2, 3]),
}
rdbStore.insert("test", valueBucket, function (err, ret) {
if (err) {
console.info("Insert failed, err: " + err)
return
}
console.log("Insert successfully: " + ret)
})
await rdbStore.insert("test", valueBucket)
rdbStore.commit()
```
......@@ -1667,13 +1661,7 @@ const valueBucket = {
"blobType": new Uint8Array([1, 2, 3]),
}
rdbStore.insert("test", valueBucket, function (err, ret) {
if (err) {
console.info("Insert failed, err: " + err)
return
}
console.log("Insert successfully: " + ret)
})
await rdbStore.insert("test", valueBucket)
rdbStore.commit()
```
......@@ -1697,13 +1685,7 @@ try {
"salary": 100.5,
"blobType": new Uint8Array([1, 2, 3]),
}
rdbStore.insert("test", valueBucket, function (err, ret) {
if (err) {
console.info("Insert failed, err: " + err)
return
}
console.log("Insert successfully: " + ret)
})
await rdbStore.insert("test", valueBucket)
rdbStore.commit()
} catch (e) {
rdbStore.rollBack()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册