Unfortunately, part of the whole point of my system is that all I
store is the ISBN (and my own recommendation).  I get everything else
from Amazon daily, which includes the price info, etc.  Maybe I have
to save all of that in persistent storage and just refresh it every
day, but I was hoping to avoid all that.

If you're curious about the site, it's at http://recommended-books.kousenit.com
.  Its purpose is to be a simple illustration of how to use Java and
Groovy on GAE.

I'm more concerned, though, that I'm misunderstanding what the cache
is for.  If there's a separate cache on each instance of the cluster,
then it's much less useful for this particular application.

Ken

On Oct 28, 11:24 am, Nick <[email protected]> wrote:
> So this boils down to JCache (google memory) vs Persistent storage
> (google disks), right?
>
> Does this pattern work instead?
>
> 1. Query Amazon for what you need
> 2. Store results using a persistent 
> storagehttp://code.google.com/appengine/docs/java/datastore/
>
> Example:http://code.google.com/appengine/docs/java/datastore/creatinggettinga...)
>
>         PersistenceManager pm = PMF.get().getPersistenceManager();
>
>         Employee e = new Employee("Alfred", "Smith", new Date());
>
>         try {
>             pm.makePersistent(e);
>         } finally {
>             pm.close();
>         }
>
> 3. Read from the persistent storage. If this is slow (I have no idea)
> you could then use JCache to cache (on each google server instance
> hosting an instance of your class) the persistent storage result the
> same way you do now
>
> On Oct 28, 10:37 am, kousen <[email protected]> wrote:
>
>
>
> > I'll definitely turn on logging and try to see what's going on.
>
> > Thanks,
>
> > Ken
>
> > On Oct 28, 4:18 am, leszek <[email protected]> wrote:
>
> > > It looks ok, the only problem I can see that something can happen
> > > between storing book in cache and getting book from cache.
> > > Scenario like:
> > > 1) fetch book from Amazon and store in cache.
> > > 2)  book expires in Amazon (or any other event happens)
> > > 3) next request - get data from cache - you return status of the book
> > > at the point 1), not the point 2).
>
> > > But maybe this problem does not matter very much.
>
> > > If you want to see if it is working simply use logging and watch the
> > > log 
> > > entries.http://code.google.com/intl/pl/appengine/docs/java/runtime.html
>
> > > I don't know if there is any method of sending request simultaneously
> > > - maybe Amazon API supports some king of "batch requests" - but I'm
> > > guessing only.- Hide quoted text -
>
> > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to