Skip to content

Commit

Permalink
Fixed issue with registration of hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
lvca committed Dec 4, 2015
1 parent 47bd7b9 commit bb82268
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,9 @@ public ODictionary<ORecord> getDictionary() {
* {@inheritDoc}
*/
public <DB extends ODatabase<?>> DB registerHook(final ORecordHook iHookImpl, final ORecordHook.HOOK_POSITION iPosition) {
checkOpeness();
checkIfActive();

final Map<ORecordHook, ORecordHook.HOOK_POSITION> tmp = new LinkedHashMap<ORecordHook, ORecordHook.HOOK_POSITION>(hooks);
tmp.put(iHookImpl, iPosition);
hooks.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ public void testLiveInsert() throws InterruptedException {
ODatabaseDocumentTx db = new ODatabaseDocumentTx("memory:OLiveQueryTest");
db.activateOnCurrentThread();
db.create();
db.registerHook(new OLiveQueryHook(db));
try {
db.getMetadata().getSchema().createClass("test");
db.getMetadata().getSchema().createClass("test2");
Expand Down

0 comments on commit bb82268

Please sign in to comment.