[OJB-developers] ODMG and referendial integrity
Brought to you by:
thma
From: Florian B. <bf...@fl...> - 2002-02-25 17:44:21
|
Hi, just commited some changes to CVS that makes it now possible to use referential integrity. Compared to the old implementation it is now guaranteed to do the following: - maintain the order of lock aquisiation if no relations are known. This makes it possible to use referential integrity constraints or for example check constraints where OJB cannot resolve the dependencies - reorder objects that are related via references or collections so violating foreign key constraints is prevents The following classes were modified: - test.ojb.odmg.RITest: modified testcase and associated Classes - ojb.odmg.states.ModificationState, ojb.odmg.states.StateNewDelete and ojb.odmg.states.StateOldDelete: Added a method needsDelete() to check whether the object will be deleted (necessary for dependency resolution) - ojb.broker.Identity: provides now a hashCode() and equals() to make it possible to use Identity as a key in a HasMap/HashTable directly. Improves speed compared to String representation. - ojb.odmg.ObjectEnvelope: add method needsDelete() - ojb.odmg.ObjectEnvelopeTable: reorder related objects so they are inserted/update/deleted in the correct order when referential integrity constraints are in place while maintaining order of lock aquisition if no dependencies are known. Adds a slight overhead of about 10% per locked object to processing when using HSQLDB. best regards, Florian |