2 Replies Latest reply on Jan 28, 2004 12:33 PM by cvandyck

    How to handle failed CMR relationship?

    cvandyck

       

      "cvandyck" wrote:
      I've got a situation where it's possible for various reasons for my entity database to become corrupted.

      For example, I have an entity A which has a CMR to B using foreign key a2b. After the database corruption, the key a2b points to a record that no longer exists.

      When I try and load this entity, I get a NoSuchObjectLocalException thrown. I would like to be able to instead assume that if the entity on the other end of the CMR does not exist, to return NULL for that relationship.

      Is this possible? I'm using JBoss 3.2.2. It seems to me that the only way that I can recover from this is to manually change records in the database, or do the same programatically using JDBC.

      Many thanks.
      Collin