title: Purposes of @Remove method in stateful EJB
body: <p>I do understand, that calling a <code>@Remove</code> annotated method will tell the EJB container, that the client do not need the instance of a stateful EJB any longer and that it can be removed after the call.</p>
  
  <p>But in the Oracle JEE tutorial this method is used to "clean" the instance. See here for example:</p>
  
  <pre><code>@Stateful
  public class CartBean implements Cart {
      // ...
      List&lt;String&gt; contents;
      // ...
      @Remove
      public void remove() {
          contents = null;
      }
  }
  </code></pre>
  
  <p>(from <a href="https://docs.oracle.com/javaee/6/tutorial/doc/bnbod.html" rel="noreferrer">https://docs.oracle.com/javaee/6/tutorial/doc/bnbod.html</a> )</p>
  
  <p>The member <code>List&lt;String&gt; contents;</code> is set to <code>null</code> but I do not see any reason to do this. When the instance is dropped, won't it kill all those kind of referrences anyway?</p>
  
  <p>I could imagine, that one need to perform some business tasks when the instance is released, but after the call of the <code>@Remove</code> method it will more or less directly invoke some <code>@PreDestroy</code> method afterwards where I could perform those tasks. So why do we have this special mechanism with the <code>@Remove</code> method and not just sth like <code>EJBContainer.remove(myBean)</code></p>
  
  <p>Could you please clarify the purposes of the <code>@Remove</code> annotation and/or give some comprehensible use-case examples where it is evident to see why we need this mechanism?</p>