onRecordAfterCreate() called multiple times

13 views
Skip to first unread message

Guruprasad Nagaraj

unread,
Apr 13, 2015, 5:01:58 AM4/13/15
to orient-...@googlegroups.com

Hi,
This is in continuation to question "Context of onRecordAfterCreate() call back" that I had posted earlier.

I have vertex classes vertexClass1 and vertexClass2.
I am creating a vertex v1 in vertexClass1, and a relationship e12 between v1 (in vertexClass1) and v2 (in vertexClass2, v2 already exists in the db).
I am seeing that onRecordAfterCreate() is called six times prior to committing the changes to the database.

13:52:20,627 INFO  [DbRepo] (default task-10) [sample_db] created vertex v1 in class vertex1 
13:52:20,635 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass1
13:52:20,639 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass1
13:52:20,639 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass1
/* I CREATE THE RELATIONSHIP e12 HERE */
13:52:20,663 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass2
13:52:20,665 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass2
13:52:20,665 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() called for sample_db, vertexClass2
13:52:20,665 INFO  [DbRepo] (default task-10) [sample_db] calling dbTx().commit()
13:52:20,673 INFO  [DbRepo] (default task-10) [sample_db] calling dbTx().shutdown() 
The relationship e12 has not special edge type class.

  @Override

  public DISTRIBUTED_EXECUTION_MODE getDistributedExecutionMode() {

    logger.info("getDistributedExecutionMode()");

    return DISTRIBUTED_EXECUTION_MODE.SOURCE_NODE;

  }


I am seeing that onRecordAfterCreate() is called six times prior to committing the changes to the database.
In each call back, the iRecord is dirty.
My expectation is that I am called back once per class that is created/updated. Is this expectation correct?

Any help is greatly appreciated.

Thanks and Best Regards,
GPN
Reply all
Reply to author
Forward
0 new messages