简体   繁体   English

在交易期间使用临时记录ID

[英]use temporary Record ID during transaction

I have record A in database. 我在数据库中记录了A。

In a transaction I want to do the following : 在交易中,我要执行以下操作:

  • Create a record B 创建记录B
  • link parent property of A to B : A.parent = B.@rid 将A的parent属性链接到B: A.parent = B.@rid

Problem is, during a transaction, I get a temporary negative record id. 问题是,在交易期间,我得到一个临时的否定记录ID。 So @rid has a negative position id. 因此, @rid具有负职位ID。 How can I use it to set the link in the same transaction ? 如何使用它在同一笔交易中设置链接?

Thank you 谢谢

The negative RID means that is temporary. 负RID表示这是暂时的。 When the transaction is committed a real RID will be assigned, after the commit the RID is changed and it's updated in the object. 提交事务后,将分配一个真实的RID,在提交之后,RID会更改并在对象中进行更新。

Here the doc at the end of the page you can see how transactions works 在页面末尾的文档中,您可以查看交易的工作方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM