tracking temporary orient identifiers

6 views
Skip to first unread message

loadedlux

unread,
Jun 17, 2018, 11:59:52 PM6/17/18
to OrientDB
Hello,

Is there a way to use a temporary identifier to determine the post commit identifier? I am trying to build a thin DAO and my save function returns a temporary id and I would like to return the actual ID. Any suggestions would be greatly appreciated!

Luigi Dell'Aquila

unread,
Jun 18, 2018, 2:19:48 AM6/18/18
to orient-...@googlegroups.com
Hi,

the final RID is assigned only after tx commit, and it does not depend on the temporary identifier, so there is no way to know it in advance.
Anyway, OrientDB automatically binds the RID to the document, so if you can manage to keep a reference to it, you can get the final RID after save/commit.
If you cannot manage it, you will have to assign some other high level identifier (eg. an application level key) and use it as a primary key.

Thanks

Luigi

Il giorno lun 18 giu 2018 alle ore 05:59 loadedlux <id.publ...@gmail.com> ha scritto:
Hello,

Is there a way to use a temporary identifier to determine the post commit identifier? I am trying to build a thin DAO and my save function returns a temporary id and I would like to return the actual ID. Any suggestions would be greatly appreciated!

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages