single-fire-per-change hooks? #9986
Replies: 1 comment 1 reply
-
Hi, @TDavidHudson, could you provide a code example that we can play with to understand your needs more precisely? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using version 3.2.19 . I would like to have a record hook that fires exactly once across a given database, regardless of the number of open database sessions, after any single insert, update, or delete. When I had a "class QueryHooks extends ODocumentHookAbstract implements ODatabaseLifecycleListener", registered in orientdb-server-config.xml, I was getting multiple onRecordAfterCreate calls for a single vertex creation. When I moved the ODatabaseLifecycleListener implementation to a different class, so as to have only a "class QueryHooks extends ODocumentHookAbstract", I got a single onRecordAfterCreate call even with two console sessions connected. In both setups, QueryHooks::getDistributedExecutionMode was returning TARGET_NODE.
But with the separate ODatabaseLifecycleListener, I saw bizarre behavior in both the QueryHooks class and the ODatabaseLifecycleListener implementation. The QueryHooks constructor was called many times, and when it was called, there was an immediate (sub-millisecond) sequence of calls to the ODatabaseLifecycleListener implementation's onOpen and onClose methods, with no activity to account for it.
Can I count on a single per-change call to onRecordAfterCreate, onRecordAfterDelete, or onRecordAfterUpdate in this setup?
Beta Was this translation helpful? Give feedback.
All reactions