RE: $2 referential integrity violation

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Wed Nov 23 2005 - 10:04:02 EST

  • Next message: Dhruti Ramani: "RE: $2 referential integrity violation"

    I think in your Deal entity, you want the Delete Rule to be "No Action",
    which will allow it to delete just the Deal record and not do anything
    to the AnnuityIssuer (you currently have it NULLing the PK -- or similar
    -- in the AnnuityIssuer, which will potentially lose track of Deals).
    So, with 10 Deals and 1 AnnuityIssuer, deleting a Deal would leave you
    with 9 Deals and 1 AnnuityIssuer -- nothing needed to be updated in the
    AnnuityIssuer.
     
    For the AnnuityIssuer entity, either "No Action" or "Cascade" or "Deny"
    might be appropriate. That means, when you delete an AnnuityIssuer, do
    nothing to the Deals, Cascade delete all the Deals (associated with the
    AnnuityIssuer), or Deny the deletion of the AnnuityIssuer if there are
    any Deals remaining in the relationship. You'll have to decide what
    makes sense for your use case.
     
    /dev/mrg

            -----Original Message-----
            From: Dhruti Ramani [mailto:dhrutiraman..ahoo.com]
            Sent: Wednesday, November 23, 2005 9:50 AM
            To: cayenne-use..bjectstyle.org
            Subject: $2 referential integrity violation
            
            
            Hi,
             
            In my application, I have relation M to 1 between Deal and
    annuityissuer.(Deal can have one issuer but one issuer can be associated
    with many deals) Now in system Deal has issuer but when i try to delete
    that issuer it raises following execption.
             
            org.postgres.util.PSQLExecption: ERROR: $2 referential integrity
    violation - key in annuityissuer still referenced from deal.
             
            In the modeler i have marked Delete Rule as "Nullify" in both
    objects. I am not database person, Am I missing something?
             
            Thanks,
            Denna

            
    ________________________________

            Yahoo! FareChase - Search multiple travel sites in one click.
    <http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2OD
    gxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//
    farechase.yahoo.com/>



    This archive was generated by hypermail 2.0.0 : Wed Nov 23 2005 - 10:04:05 EST