ObjectDB ObjectDB

Objectdb Doctor


Hi, I have deleted an instance of ClassA.

However, if I try to access ClassB, which has a field of type ClassA,

ClassB.classA, then, rather than getting a null pointer for classB.classA, I get an enormous exception.

How does the ObjectDB Doctor help?



When objects are removed/deleted from the databases - it is the application responsibility to clear any references to them from other objects in the database (except references in inverse / mapped by fields, which are not stored but rather computed on the fly by executing automatic queries).

ObjectDB Doctor can help in this context in two ways:

  • Running the Doctor in diagnosis mode once in awhile during development and testing can help in identifying failures. If the Doctor reports broken references - the information should be used to fix the application.
  • To fix broken references (i.e. to replace broken references with null values) in an existing database file you can run the Doctor in repair mode. This cannot replace fixing the application but it is an easy way to repair a specific database.
ObjectDB Support

great thanks, I'll run in diagnostic mode, see what I get,

then run in repair mode, and see how the application behaves, ie: handles nulls, rather than throwing exceptions.


And there you go:

Missing Objects (Broken References)

[1] au.model.Bidder(9):194
Referenced by:
- au.model.Bid(10):195

A Bid referencing a missing Bidder.



To post on this website please sign in.