hi all, the problem with referential integrity is caused by the deletion of all m:n implemenors when storing m:n relationships:
private void storeCollections(Object obj, Vector vecCds, Map markedForStore) throws PersistenceBrokerException { // get all members of obj that are collections and store all their elements Iterator i = vecCds.iterator(); while (i.hasNext()) { CollectionDescriptor cds = (CollectionDescriptor) i.next(); Object col = cds.getPersistentField().get(obj); if (cds.isMtoNRelation()) { /* LEANDRO * Clear all MtoN implementors. * All new MtoN implementors are going to be added bellow */ //logger.info("STORE COLLECTIONS: deleting all MtoN implementors for field "+cds.getPersistentField().getName()); deleteMtoNImplementor(cds, obj); } if (col != null) { any ideas ? jakob ----- Original Message ----- From: "Jakob Braeuchi" <[EMAIL PROTECTED]> To: "OJB Developers List" <[EMAIL PROTECTED]> Cc: "OJB Users List" <[EMAIL PROTECTED]> Sent: Wednesday, December 04, 2002 10:07 PM Subject: test cases fail with foreign keys in hsqldb > hi all, > > thanks to armin i found that torque does not create the foreign keys defined > in -schema.xml when using hsqldb. thanks to these lacking foreign keys our > test cases pass witout errors... when enabling referential integrity some > test cases fail: > > java.sql.SQLException: Integrity constraint violation: TASK_FK_1 table: TASK > in statement [DELETE FROM PERSON_PROJECT WHERE (PROJECT_ID = 1)] > at org.hsqldb.Trace.getError(Unknown Source) > ... > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.deleteMtoNImplementor(P > ersistenceBrokerImpl.java:856) > .. > at org.apache.ojb.broker.MtoNMapping.testInsertion(MtoNMapping.java:191) > > .... > > java.sql.SQLException: Integrity constraint violation: TASK_FK_1 table: TASK > in statement [DELETE FROM PERSON_PROJECT WHERE (PROJECT_ID = 2)] > .. > org.apache.ojb.broker.singlevm.PersistenceBrokerImpl.deleteMtoNImplementor(P > ersistenceBrokerImpl.java:856) > .. > at org.apache.ojb.broker.MtoNMapping.testInsertion(MtoNMapping.java:191) > > the attached .vm files are the modifications i made to enable referential > integrity for hsqldb in torque. > replace those file found in torque.jar sql\base\hypersonic with the ones > attached. i already sent these files to martin poeschl of torque. > > hth > jakob > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>