Re: Asynchronous DataStore queries on GAE with Twig-persist and other DataStore related problems

2010-04-27 Thread Piotr Tarsa
OK. To simplify question - I want to have method prepareQuery(DataStore
dataStore) in my own IModel subinterface and before page rendering I would
want to execute that method for every model. Where should I do that? Is
there some place in RequestCycle where I could do that?

2010/4/26 Piotr Tarsa piotr.ta...@gmail.com

 Hello,

 I want to use Wicket with GAE and exploit all GAE features but some
 problems arise.

 1. I'm looking for a good solution for asynchronous simulteanous queries in
 Wicket. DataStore has a functionality of asynchronous queries so I would
 want to be able to fire various queries before rendering anything and then
 return the actual model objects when rendering particular component. I think
 of an Interface (or, better, abstract class) extending IModel with an
 additional method, name it prepareModel() which would run the asynchronous
 query, so getObjet would just wait for the query to finish and then return
 the result (this way total time spend of waiting for DataStore queries will
 be at most equal to slowest query). DataStore entities are organized into
 Entity Groups where there are ancestors and descendants. So sometimes to
 find an object I must first find the ancestor. So I would want to fire the
 prepareModel() for parent components first.

 2. DataStore doesn't support joins internally and it's queries are limited
 to 1000 results (this means that GQL COUNT will never return value higher
 than 1000 even if there's more that 1000 entities that mets the
 requirements). Instead DataStore provides cursors to retrieve more than 1000
 results and GAE devs recommends using separate sharded counters instead of
 GQL COUNT's (of course if the result would never exceed 1000 then we shall
 use normal GQL COUNT). Are there any components (repeaters) in Wicket that
 supports that approach?

 3. I think that Wicket should be able to store pages from PageMap
 independently. This way we could store pages in separate entities in
 datastore (DataStore doesn't have schemas, one can store entities of any
 form as every kind) so fewer bytes would be transmitted to and from
 DataStore (Http Sessions are kept in MemCache and DiskStore).

 4. How to inject an DataStore object in Models that will be testing
 friendly?



Re: Asynchronous DataStore queries on GAE with Twig-persist and other DataStore related problems

2010-04-27 Thread Igor Vaynberg
page.onbeforerender() might work.

-igor

On Tue, Apr 27, 2010 at 12:34 PM, Piotr Tarsa piotr.ta...@gmail.com wrote:
 OK. To simplify question - I want to have method prepareQuery(DataStore
 dataStore) in my own IModel subinterface and before page rendering I would
 want to execute that method for every model. Where should I do that? Is
 there some place in RequestCycle where I could do that?

 2010/4/26 Piotr Tarsa piotr.ta...@gmail.com

 Hello,

 I want to use Wicket with GAE and exploit all GAE features but some
 problems arise.

 1. I'm looking for a good solution for asynchronous simulteanous queries in
 Wicket. DataStore has a functionality of asynchronous queries so I would
 want to be able to fire various queries before rendering anything and then
 return the actual model objects when rendering particular component. I think
 of an Interface (or, better, abstract class) extending IModel with an
 additional method, name it prepareModel() which would run the asynchronous
 query, so getObjet would just wait for the query to finish and then return
 the result (this way total time spend of waiting for DataStore queries will
 be at most equal to slowest query). DataStore entities are organized into
 Entity Groups where there are ancestors and descendants. So sometimes to
 find an object I must first find the ancestor. So I would want to fire the
 prepareModel() for parent components first.

 2. DataStore doesn't support joins internally and it's queries are limited
 to 1000 results (this means that GQL COUNT will never return value higher
 than 1000 even if there's more that 1000 entities that mets the
 requirements). Instead DataStore provides cursors to retrieve more than 1000
 results and GAE devs recommends using separate sharded counters instead of
 GQL COUNT's (of course if the result would never exceed 1000 then we shall
 use normal GQL COUNT). Are there any components (repeaters) in Wicket that
 supports that approach?

 3. I think that Wicket should be able to store pages from PageMap
 independently. This way we could store pages in separate entities in
 datastore (DataStore doesn't have schemas, one can store entities of any
 form as every kind) so fewer bytes would be transmitted to and from
 DataStore (Http Sessions are kept in MemCache and DiskStore).

 4. How to inject an DataStore object in Models that will be testing
 friendly?



-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Asynchronous DataStore queries on GAE with Twig-persist and other DataStore related problems

2010-04-27 Thread Joe Fawzy
Hi dear
Begining from GAE sdk 1.3.2 , there is query cursors and you can have more
than 1000 result

On Mon, Apr 26, 2010 at 11:43 PM, Piotr Tarsa piotr.ta...@gmail.com wrote:

 Hello,

 I want to use Wicket with GAE and exploit all GAE features but some
 problems
 arise.

 1. I'm looking for a good solution for asynchronous simulteanous queries in
 Wicket. DataStore has a functionality of asynchronous queries so I would
 want to be able to fire various queries before rendering anything and then
 return the actual model objects when rendering particular component. I
 think
 of an Interface (or, better, abstract class) extending IModel with an
 additional method, name it prepareModel() which would run the asynchronous
 query, so getObjet would just wait for the query to finish and then return
 the result (this way total time spend of waiting for DataStore queries will
 be at most equal to slowest query). DataStore entities are organized into
 Entity Groups where there are ancestors and descendants. So sometimes to
 find an object I must first find the ancestor. So I would want to fire the
 prepareModel() for parent components first.

 2. DataStore doesn't support joins internally and it's queries are limited
 to 1000 results (this means that GQL COUNT will never return value higher
 than 1000 even if there's more that 1000 entities that mets the
 requirements). Instead DataStore provides cursors to retrieve more than
 1000
 results and GAE devs recommends using separate sharded counters instead of
 GQL COUNT's (of course if the result would never exceed 1000 then we shall
 use normal GQL COUNT). Are there any components (repeaters) in Wicket that
 supports that approach?

 3. I think that Wicket should be able to store pages from PageMap
 independently. This way we could store pages in separate entities in
 datastore (DataStore doesn't have schemas, one can store entities of any
 form as every kind) so fewer bytes would be transmitted to and from
 DataStore (Http Sessions are kept in MemCache and DiskStore).

 4. How to inject an DataStore object in Models that will be testing
 friendly?



Re: Asynchronous DataStore queries on GAE with Twig-persist and other DataStore related problems

2010-04-27 Thread Piotr Tarsa
That would mean that I use only my extended WebPage...

Would that be executed on AJAX calls? I would want to execute prepareQuery
on all objects that will be updated through AJAX.

Joe:
Yes I know. I've written about cursors in my first post.

2010/4/27 Igor Vaynberg igor.vaynb...@gmail.com

 page.onbeforerender() might work.

 -igor

 On Tue, Apr 27, 2010 at 12:34 PM, Piotr Tarsa piotr.ta...@gmail.com
 wrote:
  OK. To simplify question - I want to have method prepareQuery(DataStore
  dataStore) in my own IModel subinterface and before page rendering I
 would
  want to execute that method for every model. Where should I do that? Is
  there some place in RequestCycle where I could do that?
 
  2010/4/26 Piotr Tarsa piotr.ta...@gmail.com
 
  Hello,
 
  I want to use Wicket with GAE and exploit all GAE features but some
  problems arise.
 
  1. I'm looking for a good solution for asynchronous simulteanous queries
 in
  Wicket. DataStore has a functionality of asynchronous queries so I would
  want to be able to fire various queries before rendering anything and
 then
  return the actual model objects when rendering particular component. I
 think
  of an Interface (or, better, abstract class) extending IModel with an
  additional method, name it prepareModel() which would run the
 asynchronous
  query, so getObjet would just wait for the query to finish and then
 return
  the result (this way total time spend of waiting for DataStore queries
 will
  be at most equal to slowest query). DataStore entities are organized
 into
  Entity Groups where there are ancestors and descendants. So sometimes to
  find an object I must first find the ancestor. So I would want to fire
 the
  prepareModel() for parent components first.
 
  2. DataStore doesn't support joins internally and it's queries are
 limited
  to 1000 results (this means that GQL COUNT will never return value
 higher
  than 1000 even if there's more that 1000 entities that mets the
  requirements). Instead DataStore provides cursors to retrieve more than
 1000
  results and GAE devs recommends using separate sharded counters instead
 of
  GQL COUNT's (of course if the result would never exceed 1000 then we
 shall
  use normal GQL COUNT). Are there any components (repeaters) in Wicket
 that
  supports that approach?
 
  3. I think that Wicket should be able to store pages from PageMap
  independently. This way we could store pages in separate entities in
  datastore (DataStore doesn't have schemas, one can store entities of any
  form as every kind) so fewer bytes would be transmitted to and from
  DataStore (Http Sessions are kept in MemCache and DiskStore).
 
  4. How to inject an DataStore object in Models that will be testing
  friendly?
 
 

 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org