Hi,

what's the correct way to handle BMP relationships? I have a scenario:

Cd {
  private Artist artist;
  private boolean artistLoaded;

  setArtist(Artist);
  Artist getArtist();
}

Artist {
  private Collection cds;
  private boolean cdsLoaded;

  setCds(Collection cds);
  Collection getCds();
}

Now, I would implement this so that the relationship fields (Cd.artist and
Artist.cds) are lazy loaded. Calling set() -methods would update both the
object and the parameter object, ie. bornInTheUsa.setArtist
(bruceSpringsteen) would update both bornInTheUsa.artist field AND
bruceSpringsteen.cds collection (otherwise bruceSpringsteen will have
invalid state after the call).

Is this the right way to go? Plus, can I trust that in clustered
environment also EJB's in other instances are updated? So that there is not
an invalid artist bean in some instance having bruceSpringsteen.cds missing
the bornInTheUsa?

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to