Re: [appengine-java] writing then reading entity does not fetch entity from datastore
Can you post the code? Are you reading by key? If you are using a query, you might be exposed to the eventually consistent nature of global queries in the datastore. Or is this only in the dev appserver? -- Ikai Lan Developer Programs Engineer, Google App Engine plus.ikailan.com On Fri, Feb 3, 2012 at 3:56 PM, John Goche wrote: > Hello, > > I am having the following problem. I am now using the low-level > google datastore API rather than JDO, that way I should be in a > better position to see exactly what is happening in my code. I am > writing an entity to the datastore and shortly thereafter reading it > from the datastore using Jetty and eclipse. Sometimes the written > entity is not being read. This would be a real problem if it were to > happen in production code. I am using the 2.0 RC2 API. > > I have tried this several times, sometimes the entity is retrieved > from the datastore and sometimes it is not. I am doing a simple > query on the datastore just after committing a write transaction. > > (If I run the code through the debugger things run slow enough > that the entity has a chance of being read back on the second pass). > > Any help with this issue would be greatly appreciated, > > Regards, > > John Goche > > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > google-appengine-java@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] writing then reading entity does not fetch entity from datastore
I hope this is a stupid question but you're not setting the read consistency to eventual are you? On 4 Feb 2012 01:29, "Ikai Lan (Google)" wrote: > Can you post the code? Are you reading by key? If you are using a query, > you might be exposed to the eventually consistent nature of global queries > in the datastore. Or is this only in the dev appserver? > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > plus.ikailan.com > > > > On Fri, Feb 3, 2012 at 3:56 PM, John Goche wrote: > >> Hello, >> >> I am having the following problem. I am now using the low-level >> google datastore API rather than JDO, that way I should be in a >> better position to see exactly what is happening in my code. I am >> writing an entity to the datastore and shortly thereafter reading it >> from the datastore using Jetty and eclipse. Sometimes the written >> entity is not being read. This would be a real problem if it were to >> happen in production code. I am using the 2.0 RC2 API. >> >> I have tried this several times, sometimes the entity is retrieved >> from the datastore and sometimes it is not. I am doing a simple >> query on the datastore just after committing a write transaction. >> >> (If I run the code through the debugger things run slow enough >> that the entity has a chance of being read back on the second pass). >> >> Any help with this issue would be greatly appreciated, >> >> Regards, >> >> John Goche >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google App Engine for Java" group. >> To post to this group, send email to >> google-appengine-java@googlegroups.com. >> To unsubscribe from this group, send email to >> google-appengine-java+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/google-appengine-java?hl=en. >> >> > -- > You received this message because you are subscribed to the Google Groups > "Google App Engine for Java" group. > To post to this group, send email to > google-appengine-java@googlegroups.com. > To unsubscribe from this group, send email to > google-appengine-java+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
Re: [appengine-java] writing then reading entity does not fetch entity from datastore
Thanks Ikai for your help, I was indeed running a global query and not reading by key. This was in the dev app server which AFAIK reproduces the behavior of the datastore. I would like to know, if you don't mind me asking, suppose I am not reading by key. Once a query becomes consistent, that is, I find everything the query was supposed to find, and this happens on client computer A, at that point can I assume the same will happen from any other client computer, that is, once a query appears to have become consistent can I a On Sat, Feb 4, 2012 at 2:28 AM, Ikai Lan (Google) wrote: > Can you post the code? Are you reading by key? If you are using a query, you > might be exposed to the eventually consistent nature of global queries in > the datastore. Or is this only in the dev appserver? > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > plus.ikailan.com Matthew, Not a stupid question at all. Unfortunately it is not in my best interest to put everything in the same entity group, for instance because there is a limitation as to the amount of interactions with the server per unit time period for entities in the same entity group. And if one uses the high replication server and does not query by key one will be exposed to this constraint. On Sat, Feb 4, 2012 at 3:16 AM, Matthew Jaggard wrote: > I hope this is a stupid question but you're not setting the read consistency > to eventual are you? Best Regards, John Goche -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.