RE: $2 referential integrity violation

From: Dhruti Ramani (dhrutiraman..ahoo.com)
Date: Wed Nov 23 2005 - 11:20:51 EST

  • Next message: Andrus Adamchik: "Re: working on database with cayenne and other applications"

    Thank you so much, I was misunderstading "Delete Rules".
       
      Its working now. Thanks again.
      Denna

    "Gentry, Michael (Contractor)" <michael_gentr..anniemae.com> wrote:
          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.

                    
    ---------------------------------
     Yahoo! FareChase - Search multiple travel sites in one click.



    This archive was generated by hypermail 2.0.0 : Wed Nov 23 2005 - 11:20:52 EST