There's very little cost to "connecting" to the datastore. If this is an
issue, I'd look at the low-level API for anything that could be a warm-up
request. The expensive part of this is initializing your
PersistenceManagerFactory/EntityManagerFactory, not establishing a datastore
connection.

On Tue, Jun 1, 2010 at 8:12 PM, Rahul Juneja <rahul.jun...@gmail.com> wrote:

> Ikai,
> The problem is that i am not sure when the values in the cache will be
> accessed. but anyways i have implemented it in such a way that if the value
> is not found in cache it goes to database to fetch it, but another issue
> there is that if you are making the database connection first time after the
> new jvm instance has been kicked off as it happens in Appengine,  db
> connection takes a while, sometimes around 6-7 seconds, which is kind of
> slow.
>
> Nicolas,
> Thats the reason i am fetching the data if not found in cache.
>
>
> Thanks,
> Rahul
>
> ----------------------------------------------------------
> Rahul Juneja
> http://techlabs.thoughtclicks.com
>
>
> On Tue, Jun 1, 2010 at 9:41 PM, Ikai L (Google) <ika...@google.com> wrote:
>
>> The items will get flushed if they are not getting used. If you're using
>> items once every 24 hours ... you probably do not need a cache. Use the
>> datastore instead. Rather than prevent the items from being flushed, build
>> the ability to regenerate the cache into your system or don't even bother
>> with Memcache.
>>
>> On Tue, Jun 1, 2010 at 6:24 PM, Rahul Juneja <rahul.jun...@gmail.com>wrote:
>>
>>> Ikai,
>>>
>>> I think you are right that the cache values are expiring via LRU as
>>> sometimes only some elements of the cache are flushed.
>>> But the question is my cache only has 20-30 entries and out of that 10
>>> least recently used entries are being flushed. Is there any way i can
>>> prevent this flushing as i don't want to flush if the cache is so small
>>> instead i want the cache only to flush LRU elements when the cache grows in
>>> size to maybe 100,000 entries.
>>>
>>> Any clues ?
>>>
>>> Thanks,
>>> Rahul
>>>
>>> ----------------------------------------------------------
>>> Rahul Juneja
>>> http://techlabs.thoughtclicks.com
>>>
>>>
>>> On Tue, Jun 1, 2010 at 6:56 PM, Ikai L (Google) <ika...@google.com>wrote:
>>>
>>>> No, there isn't a default expiration. How are you setting values to the
>>>> cache? Could you be expiring the items via LRU? That is - you're not using
>>>> the items in the cache, instead setting other items and pushing the older,
>>>> unused items out?
>>>>
>>>> On Wed, May 26, 2010 at 6:43 PM, Rahul <rahul.jun...@gmail.com> wrote:
>>>>
>>>>> I have a  memcache and not to mention it does live between different
>>>>> jvm instances when new jvm instances starts, i can access the cache
>>>>> but once a while i don't find any values in cache and this happened
>>>>> twice in last 24 hours. Is there any default expiration which is less
>>>>> then 24-48 hours which i am not aware of.
>>>>>
>>>>> Any help or pointers on this is appreciated.
>>>>>
>>>>> Thanks,
>>>>> Rahul
>>>>>
>>>>> --
>>>>> 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-j...@googlegroups.com.
>>>>> To unsubscribe from this group, send email to
>>>>> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
>>>>> .
>>>>> For more options, visit this group at
>>>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Ikai Lan
>>>> Developer Programs Engineer, Google App Engine
>>>> Blog: http://googleappengine.blogspot.com
>>>> Twitter: http://twitter.com/app_engine
>>>> Reddit: http://www.reddit.com/r/appengine
>>>>
>>>>  --
>>>> 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-j...@googlegroups.com.
>>>> To unsubscribe from this group, send email to
>>>> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@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-j...@googlegroups.com.
>>> To unsubscribe from this group, send email to
>>> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
>>> .
>>> For more options, visit this group at
>>> http://groups.google.com/group/google-appengine-java?hl=en.
>>>
>>
>>
>>
>> --
>> Ikai Lan
>> Developer Programs Engineer, Google App Engine
>> Blog: http://googleappengine.blogspot.com
>> Twitter: http://twitter.com/app_engine
>> Reddit: http://www.reddit.com/r/appengine
>>
>>  --
>> 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-j...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@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-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com<google-appengine-java%2bunsubscr...@googlegroups.com>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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-j...@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.

Reply via email to