title: EMF cross references and CDO
body: <p>I want to persist my EMF model in such a way to avoid duplicating objects unnecessarily. To do so I'm trying to use cross-references, but it throws an Exception saying that the reference is not contained in a resource.</p>
  
  <p>For example, let's consider a Company and its CEO. There are two scenarios for calls of </p>
  
  <pre><code>company1.setCEO(ceo1);
  company2.setCEO(ceo1);
  </code></pre>
  
  <p>1- when containment is set to true, only the last company stores the reference to the ceo;
  2- when containment is set to false, the exception is thrown.</p>
  
  <p>How do I fix this?</p>