简体   繁体   中英

use temporary Record ID during transaction

I have record A in database.

In a transaction I want to do the following :

  • Create a record B
  • link parent property of A to B : A.parent = B.@rid

Problem is, during a transaction, I get a temporary negative record id. So @rid has a negative position id. How can I use it to set the link in the same transaction ?

Thank you

The negative RID means that is temporary. 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.

Here the doc at the end of the page you can see how transactions works

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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