title: App-Engine JDO consistent reading not working, maybe caching?
body: <p>Today it's the first time I'm using GWT and JDO. I am running it with Eclipse in the local debug mode.</p>
  
  <p>I do the following thing:</p>
  
  <pre><code>    public Collection&lt;MyObject&gt; add(MyObject o) {
  PersistenceManager pm = PMF.get().getPersistenceManager();
  try {
      pm.makePersistent(o);
      Query query = pm.newQuery(MyObject.class);// fetch all objects incl. o. But o only sometimes comes...
  List&lt;MyObject&gt; rs = (List&lt;MyObject&gt;) query.execute();
  ArrayList&lt;MyObject&gt; list= new ArrayList&lt;MyObject&gt;();
  for (MyObject r : rs) {
      list.add(r);
  }
  return list; 
  } finally {
      pm.close();
  }
  }
  </code></pre>
  
  <p>I already set <code>&lt;property name="datanucleus.appengine.datastoreReadConsistency" value="STRONG" /&gt;</code> in my <code>jdoconfig.xml</code>. Do I have to set some other transaction stuff in the config? Was somebody got a working <code>jdoconfig.xml</code>? Or is the problem somewhere else? Some caching inbetween?</p>
  
  <p><strong>EDIT:</strong> Things I have tried:</p>
  
  <ul>
  <li>Setting NontransactionalRead/Write to false</li>
  <li>Using the same/a different <code>PersistenceManager</code> though calling <code>PMF.get().getPersistenceManager()</code> multiple times</li>
  <li>Using transactions</li>
  <li>ignoreCache = true on  <code>PersistenceManager</code></li>
  <li>calling <code>flush</code> and <code>checkConsistency</code></li>
  </ul>
  
  <p>The jdoconfig:</p>
  
  <pre><code>    &lt;persistence-manager-factory name="transactions-optional"&gt;
  &lt;property name="datanucleus.appengine.datastoreReadConsistency" value="STRONG" /&gt;
      &lt;property name="javax.jdo.PersistenceManagerFactoryClass"
          value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/&gt;
      &lt;property name="javax.jdo.option.ConnectionURL" value="appengine"/&gt;
      &lt;property name="javax.jdo.option.NontransactionalRead" value="true"/&gt;
      &lt;property name="javax.jdo.option.NontransactionalWrite" value="true"/&gt;
      &lt;property name="javax.jdo.option.RetainValues" value="true"/&gt;
      &lt;property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/&gt;
  &lt;/persistence-manager-factory&gt;
  </code></pre>
  
  <p>I must be missing something central here because all approaches fail...</p>
  
  <p><strong>EDIT2:</strong> When I split the job into two transaction the log says that the write transaction fished and then the read transaction starts. But it doesn't find the just persited object. It always says <code>Level 1 Cache of type "weak" initialised</code> aswell. Is week bad or good?</p>
  
  <p>It about 30% of requests that go wrong... Might I be some lazy query loading issue?</p>