Thanks for a clue, Don. I will change primitive long to Long, but anyway thats strange, because I'm using increment() version that should return initial value, in case there's no value yet, which is zero for me.
On 15 мар, 19:39, Don Schwarz <[email protected]> wrote: > It is not possible for MemcacheServiceFactory.getMemcacheService() to return > null. > > I suspect what is happening is that MemcacheService.increment() is returning > null, which means that no value for that key was stored in the cache. If > you try to store the return value in a long primitive variable, you will get > a NullPointerException on this line. > > I would recommend that you either change your variable to a Long and check > for null explicitly, or to call the form of increment() that takes an > initial value (however in this case it can still return null if there is an > error). > > On Mon, Mar 15, 2010 at 8:26 AM, dmitrygusev <[email protected]> wrote: > > Hi, > > how could it be possible that > > MemcacheServiceFactory.getMemcacheService() returned null? > > I can't find anything in docs about this, but I had this situation in > > production. > > > Could it be because I'm invoking > > MemcacheServiceFactory.getMemcacheService() too many times? > > > Here's what I'm doing: > > > long id = getMemcacheService().increment(taskId, 1, 0); > > > -- > > 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]<google-appengine-java%[email protected]> > > . > > 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 [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.
