Ah, so I figured out what is going on with this. This is the code that is
running in production, the SDK does not have a serializable version of
LazyList as we don't explicitly support it through the interface. 1.5.1 will
have these changes in the SDK though.

On Fri, Jun 10, 2011 at 9:44 AM, Alfred Fuller <
arfuller+appeng...@google.com> wrote:

> Hmm. The one on code.google.com seems to be out of date. The version
> shipping with the SDK has:
>
> private final transient 
> QueryResultIteratorImpl<https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/QueryResultIteratorImpl.java&ct=xref_jump_to_def&l=27>
> resultIterator<https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_usages&gs=java:Lcom/google/appengine/api/datastore/LazyList;.resultIterator)Lcom/google/appengine/api/datastore/QueryResultIteratorImpl;&l=32&gsn=resultIterator>
> ;
>
> ...
>
>   /**   * Custom serialization logic to ensure that we read the entire result 
> set   * before we serialize.   */  private void writeObject 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_usages&gs=java:Lcom/google/appengine/api/datastore/LazyList;.writeObject(Ljava/io/ObjectOutputStream;)V%257CLjava/io/IOException;&l=354&gsn=writeObject>(ObjectOutputStream
>  
> <http://www.google.com/url?sa=D&q=http%3A%2F%2Fjava.sun.com%2Fjavase%2F6%2Fdocs%2Fapi%2Fjava%2Fio%2FObjectOutputStream.html>
>  out 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_usages&gs=java:Lcom/google/appengine/api/datastore/LazyList;.writeObject(Ljava/io/ObjectOutputStream;)V%257CLjava/io/IOException;%23out&l=354&gsn=out>)
>  throws IOException 
> <http://www.google.com/url?sa=D&q=http%3A%2F%2Fjava.sun.com%2Fjavase%2F6%2Fdocs%2Fapi%2Fjava%2Fio%2FIOException.html>
>  {    // Resolve all data before we serialize.    resolveAllData 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_jump_to_def&l=52>();
>     // Get ahold of the cursor before we serialize.    cursor 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_jump_to_def&l=43>
>  = getCursor 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_jump_to_def&l=340>();
>     out 
> <https://cs.corp.google.com/#google3/java/com/google/appengine/api/datastore/LazyList.java&ct=xref_jump_to_def&l=354>.defaultWriteObject
>  
> <http://www.google.com/url?sa=D&q=http%3A%2F%2Fjava.sun.com%2Fjavase%2F6%2Fdocs%2Fapi%2Fjava%2Fio%2FObjectOutputStream.html%23defaultWriteObject()>();
>   }
>
>
> On Thu, Jun 9, 2011 at 4:12 PM, Jeff Schnitzer <j...@infohazard.org>wrote:
>
>> On Thu, Jun 9, 2011 at 3:30 PM, Alfred Fuller
>> <arfuller+appeng...@google.com> wrote:
>> >
>> > Funny because we actually don't have this feature in python (only
>> iterators
>> > async prefetch). Ya, I would hope coders would use asIterable() when
>> doing a
>> > single for loop. The real win for asList() async prefetch is in these
>> > situations:
>> > List l = q.asList();  // returns immediately
>> > .... other work/rpcs...
>> > ... use l ...
>> > and
>> > // Launches and runs both queries in parallel
>> > List l1 = q1.asList();  // returns immediately
>> > List l2 = d2.asList();  // returns immediately
>> > ... use l1 and l2 ...
>>
>> Ah, that makes total sense.
>>
>> > The lazy list implementation in the low level is both lazy and
>> serializable.
>> > You should be able to do something similar in Objectify.
>>
>> This I don't understand.  Looking at LazyList I see it references
>> QueryResultIteratorImpl and has no way of fully populating itself on
>> serialization.  These classes might implement Serializable but you
>> sure can't serialize them!  At least not if you want a useful set of
>> data on the other side.
>>
>> For example, this works right now:
>>
>> List<Foo> myRemoteMethod() {
>>   return ObjectifyService.begin().query(Foo.class).list();
>> }
>>
>> But unless I'm missing something really obvious, this will not work:
>>
>> List<Entity> myRemoteMethod() {
>>   return DatastoreServiceFactory.getDatastoreService.prepare(new
>> Query("Foo")).asList();
>> }
>>
>> Jeff
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to google-appengine@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to