Ticket #1043 (accepted Defect)
Core API: using addAssocDef() inappropriately corrupts the DB
Reported by: | jri | Owned by: | jri |
---|---|---|---|
Priority: | Blocker | Milestone: | Release 4.8.5 |
Component: | DeepaMehta Standard Distribution | Version: | 4.8.4 |
Keywords: | Cc: | dgf, Malte, JuergeN | |
Complexity: | 3 | Area: | Application Framework / API |
Module: | deepamehta-core |
Description
In a migration a developer often uses this one to add an assoc def to a type:
dm4.getTopicType("infobits.tree").addAssocDef( mf.newAssociationDefinitionModel("dm4.core.aggregation_def", "infobits.infobit", "dm4.files.file", "dm4.core.many", "dm4.core.many"));
If the type URI passed to getTopicType() does not match the parent type URI in the newAssociationDefinitionModel() call (2nd argument) the DB gets corrupted:
DB inconsistency: type "infobits.tree" has 3 association definitions but in sequence are 4
The Core should check that condition and reject that addAssocDef() call by throwing an exception.
Change History
Note: See
TracTickets for help on using
tickets.