title: Google App Engine error Object Manager has been closed
body: <p>I had following error from Google App Engine when I was trying to iterate list in JSP page with EL.</p>
  
  <pre><code>Object Manager has been closed
  </code></pre>
  
  <p>I solved problem with following code, but I don't think that it is very good solution to this problem:</p>
  
  <pre><code>public List&lt;Item&gt; getItems() {
          PersistenceManager pm = getPersistenceManager();
          Query query = pm.newQuery("select from " + Item.class.getName());
          List&lt;Item&gt; items = (List&lt;Items&gt;) query.execute();       
          List&lt;Item&gt; items2 = new ArrayList&lt;Item&gt;(); // This line solved my problem 
          Collections.copy(items, items2); // and this also 
          pm.close();
          return (List&lt;Item&gt;) items;
      }
  </code></pre>
  
  <p>When I tried to use pm.detachCopyAll(items) it gave same error. I understood that detachCopyAll() method should do same what I did, but that method should be part of data nucelus, so it should be used instead of my owm methods. So why dosen't detachCopyAll() work at all?</p>