CLoud数据存储区:交易实施细节和监控

时间:2018-10-11 13:28:11

标签: google-cloud-datastore datastore

我最近开始使用交易。但是,我缺少一些文档。

到目前为止,我有一个常规的saveget函数正在调用数据存储。我正在测量这些延迟。

在进行事务处理时,我实际上如何使用下面的代码* typescript打入网络(请查看内联注释)

 public async transactionTest(key: any, data: any) {
const transaction: DatastoreTransaction = this.datastore.transaction();
await transaction.run();
// is the save already a network call? I would assume that it's not.
transaction.save({
  key: key,
  data: data
});

// I'm trying to fetch the entity which I've just saved above which is not yet commited 
// This works 
// I assumed that GET is only a network call,
//  does it first try to fetch the objects saved in the transaction? 
var entity = await transaction.get(key);

await transaction.commit();

}

事务中的哪些函数实际上执行方法调用,并且值得衡量延迟和错误?

我希望蚂蚁getquery。但是save呢?

0 个答案:

没有答案