when doing inserting a object A that has 1:n
relationship with a collection of object B, I am
getting this error:

java.sql.SQLException: ORA-02291: integrity constraint
(SCI_DEV.DUSOI_ASSESSMENT_FK) violated - parent key
not found.

at
org.apache.ojb.broker.accesslayer.JdbcAccessImpl.executeInsert(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollectionObject(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeCollections(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.storeToDb(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.PersistenceBrokerImpl.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
        at
org.apache.ojb.broker.core.DelegatingPersistenceBroker.store(Unknown
Source)
        at
gov.va.med.sci.dao.BasicDAO.insert(BasicDAO.java:65)

it looks like ojb will insert the collection records 
before inserting the parent record.  The auto
increment sequence is generated by ojb for the parent
table's primary key (ID), which is the foreign key for
the children table.  data are loaded into collection
of object B before inserting A.  Do you know why it
error out?

Thanks.

Paul

    


        
                
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25�
http://photos.yahoo.com/ph/print_splash

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to