On Monday, April 13, 2015 at 12:56:28 PM UTC+5:30, Guruprasad Nagaraj wrote:
>
> Hi,
> I am using 2.0.6.
>
> I use the following calls to create/update a record -
>
> - Get an instance of dbTx() from OrientGraphFactory
> - Create vertices or retrieve and update
> - dbTx().commit()
> - Finally release the tx instance using dbTx().shutdown()
>
> I am trying to see if I can use Hooks/Triggers to automate some 
> functionality post create or update.
> My question is - Is the onRecordAfterCreate() and onRecordAfterUpdate() 
> called within the same thread that executes the code above?
> If that is the case, then any changes to the graph in the above call back 
> methods should also be followed by a commit(). Correct?
>
> Thanks and Best Regards,
> GPN
>

Did a small test and the call back method is indeed called in the same 
context -

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, vertex1
13:52:20,639 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() 
called for sample_db, vertex1
13:52:20,639 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() 
called for sample_db, vertex1
13:52:20,663 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() 
called for sample_db, vertex2
13:52:20,665 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() 
called for sample_db, vertex2
13:52:20,665 INFO  [RepoHooks] (default task-10) onRecordAfterCreate() 
called for sample_db, vertex2
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() 

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to