Discussion:
[orientdb] tracking temporary orient identifiers
loadedlux
2018-06-18 03:59:52 UTC
Permalink
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-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Luigi Dell'Aquila
2018-06-18 06:19:33 UTC
Permalink
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
Post by loadedlux
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
For more options, visit https://groups.google.com/d/optout.
--
---
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-database+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...