[OJB-developers] Problems: Referantial Integrity, Key Generation with Informix
Brought to you by:
thma
From: Florian B. <bf...@fl...> - 2002-02-21 16:32:42
|
Hi, During some testing I discovered two problems, one for all databases and another one specific to Informix. I have a test case that exposes the more generic problem and I have a test case that exposes the informix specific problem (Oracle and HSQLDB do not show the specific problem). Both test cases share the same table and repository definition. The table definition is as follows: e DROP TABLE MDTEST_DETAIL_FKNOPK; e DROP TABLE MDTEST_DETAIL_FKINPK; e DROP TABLE MDTEST_MASTER; e CREATE TABLE MDTEST_MASTER ( MASTERID INT NOT NULL PRIMARY KEY, MASTER_TEXT VARCHAR(255) ); ; e CREATE TABLE MDTEST_DETAIL_FKINPK ( MASTERID INT NOT NULL, DETAILID INT NOT NULL, DETAIL_TEXT VARCHAR(255), PRIMARY KEY (MASTERID, DETAILID), FOREIGN KEY (MASTERID) REFERENCES MDTEST_MASTER(MASTERID) ); ; e CREATE TABLE MDTEST_DETAIL_FKNOPK ( DETAILID INT NOT NULL PRIMARY KEY, MASTERID INT NOT NULL, DETAIL_TEXT VARCHAR(255), FOREIGN KEY (MASTERID) REFERENCES MDTEST_MASTER(MASTERID) ); MDTEST_MASTER is the master table for MDTEST_DETAIL_FKINPK and MDTEST_DETAIL_FKNOPK. The detail tables differ in the way the primary key is defined, in MDTEST_DETAIL_FKINPK the foreign key referencing to MDTEST_MASTER is part of the primary key, in MDTEST_DETAIL_FKNOPK the foreign key is just an attribute. MDTEST_DETAIL_FKNOPK exposes the generic problem I have, MDTEST_DETAIL_FKINPK additionally exposes the informix specific problem. The repository definition for those tables is as follows: <ClassDescriptor id="10000"> <class.name>test.ojb.odmgmd.Master</class.name> <table.name>MDTEST_MASTER</table.name> <FieldDescriptor id="1"> <field.name>masterId</field.name> <column.name>MASTERID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> <autoincrement>true</autoincrement> </FieldDescriptor> <FieldDescriptor id="2"> <field.name>masterText</field.name> <column.name>MASTER_TEXT</column.name> <jdbc_type>VARCHAR</jdbc_type> </FieldDescriptor> <CollectionDescriptor id="1"> <cdfield.name>collDetailFKinPK</cdfield.name> <items.class>test.ojb.odmgmd.DetailFKinPK</items.class> <inverse_fk_descriptor_ids>1</inverse_fk_descriptor_ids> </CollectionDescriptor> <CollectionDescriptor id="2"> <cdfield.name>collDetailFKnoPK</cdfield.name> <items.class>test.ojb.odmgmd.DetailFKinPK</items.class> <inverse_fk_descriptor_ids>1</inverse_fk_descriptor_ids> </CollectionDescriptor> </ClassDescriptor> <ClassDescriptor id="10001"> <class.name>test.ojb.odmgmd.DetailFKinPK</class.name> <table.name>MDTEST_DETAIL_FKINPK</table.name> <FieldDescriptor id="1"> <field.name>masterId</field.name> <column.name>MASTERID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> </FieldDescriptor> <FieldDescriptor id="2"> <field.name>detailId</field.name> <column.name>DETAILID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> <autoincrement>true</autoincrement> </FieldDescriptor> <FieldDescriptor id="3"> <field.name>detailText</field.name> <column.name>DETAIL_TEXT</column.name> <jdbc_type>VARCHAR</jdbc_type> </FieldDescriptor> <ReferenceDescriptor id="1"> <rdfield.name>aMaster</rdfield.name> <referenced.class>test.ojb.odmgmd.Master</referenced.class> <fk_descriptor_ids>1</fk_descriptor_ids> </ReferenceDescriptor> </ClassDescriptor> <ClassDescriptor id="10002"> <class.name>test.ojb.odmgmd.DetailFKnoPK</class.name> <table.name>MDTEST_DETAIL_FKNOPK</table.name> <FieldDescriptor id="2"> <field.name>detailId</field.name> <column.name>DETAILID</column.name> <jdbc_type>INTEGER</jdbc_type> <PrimaryKey>true</PrimaryKey> <autoincrement>true</autoincrement> </FieldDescriptor> <FieldDescriptor id="1"> <field.name>masterId</field.name> <column.name>MASTERID</column.name> <jdbc_type>INTEGER</jdbc_type> </FieldDescriptor> <FieldDescriptor id="3"> <field.name>detailText</field.name> <column.name>DETAIL_TEXT</column.name> <jdbc_type>VARCHAR</jdbc_type> </FieldDescriptor> <ReferenceDescriptor id="1"> <rdfield.name>aMaster</rdfield.name> <referenced.class>test.ojb.odmgmd.Master</referenced.class> <fk_descriptor_ids>1</fk_descriptor_ids> </ReferenceDescriptor> </ClassDescriptor> The following code shows the problem. The behaviour I expected is that first the master objects are made persistent and then the detail objects. tx.begin(); Master aMaster1 = new Master(); aMaster1.masterText = "Master 1"; aMaster1.collDetailFKnoPK = new java.util.Vector(); for (int i = 0; i < 5; i++) { DetailFKnoPK aDetail = new DetailFKnoPK(); aDetail.detailText = "Artikel " + i + " in Produktgruppe 1"; aDetail.aMaster = aMaster1; aMaster1.collDetailFKnoPK.add(aDetail); } Master aMaster2 = new Master(); aMaster2.masterText = "Master 2"; aMaster2.collDetailFKnoPK = new java.util.Vector(); for (int i = 0; i < 5; i++) { DetailFKnoPK aDetail = new DetailFKnoPK(); aDetail.detailText = "Artikel " + i + " in Produktgruppe 1"; aDetail.aMaster = aMaster2; aMaster2.collDetailFKnoPK.add(aDetail); } db.makePersistent(aMaster1); db.makePersistent(aMaster2); tx.commit(); The problem is, OJB tries to make the detail persistent before the master is persistent, resulting in a foreign key constraint violation. The output is as follows (for Informix, very similar for HSQLDB): [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity ojb.broker.util.HighLowSequence{test.ojb.odmgmd.Master,masterId} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@11d8c1 [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@11d8c1, true [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.Master{1} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity ojb.broker.util.HighLowSequence{test.ojb.odmgmd.DetailFKnoPK,detailId} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@6df84b [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@6df84b, true [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{1} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{2} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{3} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{4} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{5} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.Master{2} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{6} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{7} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{8} [junit] org.odmg.TransactionAbortedException: Missing key in referenced table for referential constraint (informix.r696_1460). [junit] at ojb.odmg.ObjectEnvelopeTable.commit(ObjectEnvelopeTable.java:86) [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{9} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKnoPK{10} [junit] at ojb.odmg.TransactionImpl.doCommit(TransactionImpl.java:196) [junit] at ojb.odmg.TransactionImpl.commit(TransactionImpl.java:347) [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store test.ojb.odmgmd.DetailFKnoPK@246701, true [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKnoPK(OdmgTestCollecti onsAndReferences.java:92) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] F [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] Time: 2,483 [junit] There was 1 failure: [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] 1) testFKnoPK(test.ojb.odmgmd.OdmgTestCollectionsAndReferences)junit.framework. AssertionFailedError: testFKnoPK: Missing key in referenced table for referential constraint (informix.r696_1460). [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKnoPK(OdmgTestCollecti onsAndReferences.java:97) Now the second testcase. I have to say that I modified the Exception handling of OJB a little bit on the path to the source of the problem, so whenever a new exception is thrown as a result of another exception, the stacktrace is printed. The source is similar to testcase 1, the only difference is that the detail class is now DetailFKinPK. The result is the following: [junit] .[BOOT] INFO: OJB.properties: file:/C:/work/OJB/ojb-0.7.343-src/ojb-0.7.343/build/test/ojb/OJB.properties [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity ojb.broker.util.HighLowSequence{test.ojb.odmgmd.Master,masterId} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@11d8c1 [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@11d8c1, true [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.Master{1} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity ojb.broker.util.HighLowSequence{test.ojb.odmgmd.DetailFKinPK,detailId} [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@6df84b [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: store ojb.broker.util.HighLowSequence@6df84b, true [junit] [ojb.broker.singlevm.PersistenceBrokerImpl] INFO: getObjectByIdentity test.ojb.odmgmd.DetailFKinPK{null,1} [junit] [DEFAULT] ERROR: bindSelect failed for: test.ojb.odmgmd.DetailFKinPK{null,1}, PK: 0, value: null [junit] java.sql.SQLException: System or internal error java.lang.NullPointerException [junit] at com.informix.util.IfxErrMsg.getSQLException(IfxErrMsg.java:423) [junit] at com.informix.jdbc.IfxPreparedStatement.setObject(IfxPreparedStatement.java:2 243) [junit] at ojb.broker.accesslayer.StatementManager.bindSelect(StatementManager.java:317 ) [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:342) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl. java:1090) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro kerImpl.java:1208) [junit] at ojb.odmg.ObjectEnvelope.setInitialModificationState(ObjectEnvelope.java:247) [junit] at ojb.odmg.ObjectEnvelope.<init>(ObjectEnvelope.java:74) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:481) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.TransactionImpl.lockCollections(TransactionImpl.java:535) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:495) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:220) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] System or internal error java.lang.NullPointerException [junit] at ojb.broker.accesslayer.JdbcAccess.materializeObject(JdbcAccess.java:369) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getDBObject(PersistenceBrokerImpl. java:1090) [junit] at ojb.broker.singlevm.PersistenceBrokerImpl.getObjectByIdentity(PersistenceBro kerImpl.java:1208) [junit] at ojb.odmg.ObjectEnvelope.setInitialModificationState(ObjectEnvelope.java:247) [junit] at ojb.odmg.ObjectEnvelope.<init>(ObjectEnvelope.java:74) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:481) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.TransactionImpl.lockCollections(TransactionImpl.java:535) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:495) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:220) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] org.odmg.ODMGRuntimeException: System or internal error java.lang.NullPointerException [junit] at ojb.odmg.ObjectEnvelope.setInitialModificationState(ObjectEnvelope.java:252) [junit] at ojb.odmg.ObjectEnvelope.<init>(ObjectEnvelope.java:74) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:481) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.TransactionImpl.lockCollections(TransactionImpl.java:535) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:495) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:220) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] org.odmg.LockNotGrantedException: System or internal error java.lang.NullPointerException [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:167) [junit] at ojb.odmg.TransactionImpl.lockCollections(TransactionImpl.java:535) [junit] at ojb.odmg.TransactionImpl.register(TransactionImpl.java:495) [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:162) [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:220) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] org.odmg.LockNotGrantedException: System or internal error java.lang.NullPointerException [junit] at ojb.odmg.TransactionImpl.lock(TransactionImpl.java:167) [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:220) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) [junit] org.odmg.ODMGRuntimeException [junit] at ojb.odmg.DatabaseImpl.makePersistent(DatabaseImpl.java:229) [junit] at test.ojb.odmgmd.OdmgTestCollectionsAndReferences.testFKinPK(OdmgTestCollecti onsAndReferences.java:134) [junit] at java.lang.reflect.Method.invoke(Native Method) [junit] at junit.framework.TestCase.runTest(TestCase.java:166) [junit] at junit.framework.TestCase.runBare(TestCase.java:140) [junit] at junit.framework.TestResult$1.protect(TestResult.java:106) [junit] at junit.framework.TestResult.runProtected(TestResult.java:124) [junit] at junit.framework.TestResult.run(TestResult.java:109) [junit] at junit.framework.TestCase.run(TestCase.java:131) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.framework.TestSuite.runTest(TestSuite.java:173) [junit] at junit.framework.TestSuite.run(TestSuite.java:168) [junit] at junit.textui.TestRunner.doRun(TestRunner.java:74) [junit] F [junit] at junit.textui.TestRunner.start(TestRunner.java:234) [junit] at junit.textui.TestRunner.main(TestRunner.java:112) As you can see, StatementManager wants to bind a parameter to a select statement, unfortunately this parameter is null at that time, because it is the foreign key to Master and this key is not set at that time. The reason why the Informix JDBC driver crashes here is that it is unable to type the null value correctly. If I set the type of the parameter in setObject hardcoded to Types.INTEGER the setObject works and the behaviour is the same as with the Oracle and the HSQLDB JDBC driver. I am quite lost with these two problems as this seems to touch the internals of OJB. Attached is the complete JUnit test case so you can see the problems. best regards, Florian |