提交 c07f5971 编写于 作者: P PaDaBoo

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

Signed-off-by: NPadaboo <xuejianwu@huawei.com>
上级 b0252810
......@@ -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.
先完成此消息的编辑!
想要评论请 注册