OnAfterCreate hook retrieves the temporary identity of a document rather than the permanent


#1

I have created server-side hooks to record changes to the DB in an audit_trail table.
The hook is an implementation of ORecordHook.
In the onTrigger method I have the following code:
if (oRecord instanceof ODocument)
{
ODocument doc = (ODocument)oRecord;
String rid = doc.getIdentity().toString();

case AFTER_CREATE: createHook(…, rid, …)
}
The rid I’m getting is the temporary @rid rather than the actual permanent one.


#2

Hi, which version of ODB are you using?


#3

The version of OrientDB is 3.0.12