title: datastore dirty reads and deletes
body: <p>I've posted a question earlier <a href="https://stackoverflow.com/questions/10450936/datastore-deleting-entities-outside-transactions">datastore: deleting entities outside transactions</a> but did not get much luck on that, maybe i was too complex at describing the problem so I'll try to hit that problem with a different question:</p>
  
  <p>I'm not using any transaction with my entity and realize that i could loose committed updates because of dirty reads and totally OK with it (mainly statistics). the only thing i need for sure is that if i delete it after a dirty read was already made but no update was committed yet that it won't write that entity back. I don't want to introduce contention or performance issues by using transactions because deletes are rare and update are many.</p>
  
  <pre><code>Servlet A
  {
     entity = persistenceManager.getObjectById(Entity.class, key)
     //Stuff
     persistenceManager.deletePersistent(entity);
  }
  
  
  Servlet B
  {
     entity = persistenceManager.getObjectById(Entity.class, key) // dirty read made before deletion
  
     //Updated some fields, after deletion was commited
     persistenceManager.flush(); ? the object would be written back
  }
  </code></pre>
  
  <p>I've tested the case above by introducing 20 seconds sleep in B between dirty read and delete and it does write the object back (Actually that is the answer for the first question, will update that question).</p>
  
  <p>Can i rely on memcache to let Servlet B before getting the entity know that A is about to delete the entity let us say by looking a Boolean cache entry 'deleting-entity-[KEY]' being put from A and if it is there then i should not read the entity in servlet B, I know that memcache does not guarantee not evicting data but if it is there is it instantly accessible from servlet B?</p>
  
  <p>Any better ideas out there?</p>