Orientdb 是否可以在orientjs中使用带有th类API的事务?
我在文档中似乎找不到任何关于使用API类的事务的信息 有一个启动新事务的Orientdb 是否可以在orientjs中使用带有th类API的事务?,orientdb,orientjs,Orientdb,Orientjs,我在文档中似乎找不到任何关于使用API类的事务的信息 有一个启动新事务的Db#begin()方法。因此,鉴于以下代码: const db = server.use('MyDb'); const transaction = db.begin(); const Product = await transaction.db.class.get('Product'); //Transaction already gets committed to the database here before com
Db#begin()
方法。因此,鉴于以下代码:
const db = server.use('MyDb');
const transaction = db.begin();
const Product = await transaction.db.class.get('Product');
//Transaction already gets committed to the database here before commit is executed
await Product.create({name: 'Milk', brand: 'Clover'})
transaction.commit()
我原以为只有在transaction.commit()
上提交事务,但它会立即提交。我知道db.let()
语法,但是上面的类似内容更容易使用
如果不能将
类#create(record)
方法用于事务,我看不到它的价值。这让我相信我错过了什么,但我已经绞尽脑汁在这最后一天了 您好,Marthinus Engelbrecht,您使用哪个版本的Orientdb?我在2.2中尝试过这个。但是在3中的文档中没有看到任何关于它的内容