Return-Path: Mailing-List: contact ojb-dev-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ojb-dev@jakarta.apache.org Received: (qmail 12 invoked by uid 98); 4 Dec 2002 21:20:10 -0000 X-Antivirus: nagoya (v4218 created Aug 14 2002) Received: (qmail 29422 invoked from network); 4 Dec 2002 21:20:04 -0000 Received: from daedalus.apache.org (HELO apache.org) (63.251.56.142) by nagoya.betaversion.org with SMTP; 4 Dec 2002 21:20:04 -0000 Received: (qmail 61979 invoked by uid 500); 4 Dec 2002 21:18:54 -0000 Received: (qmail 61961 invoked from network); 4 Dec 2002 21:18:53 -0000 Received: from mail.gmx.net (213.165.64.20) by daedalus.apache.org with SMTP; 4 Dec 2002 21:18:53 -0000 Received: (qmail 32409 invoked by uid 0); 4 Dec 2002 21:18:57 -0000 Received: from adsl-62-167-176-64.adslplus.ch (HELO oahu) (62.167.176.64) by mail.gmx.net (mp018-rz3) with SMTP; 4 Dec 2002 21:18:57 -0000 Message-ID: <00d601c29bda$af899380$40b0a73e@oahu> From: "Jakob Braeuchi" To: "OJB Developers List" References: <002401c29bd9$33235fc0$40b0a73e@oahu> Subject: Re: test cases fail with foreign keys in hsqldb Date: Wed, 4 Dec 2002 22:18:26 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N 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" To: "OJB Developers List" Cc: "OJB Users List" 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: > For additional commands, e-mail: