0
votes

I'm new in Google App Engine and I am creating a web app that uses memcache(Java).

I have 2 different classes of memcache, one to store Users and another one to store Events. Each one of them uses their IDs as the key to store the data in the memcache. So my problem is, i.e. when I store an Event with the ID 115 and later I store a User with the same ID 115, the Event data is overwritten with this User data.

So, is it possible to have different instances of memcache in order to avoid this? Or am I obligated to use always unique keys?

Thank you very much in advance everyone :)

1

1 Answers

2
votes

There is only one Memcache available to your application. You cannot have multiple instances.

A simple solution is to use an entity key, instead of ID, when adding/retrieving entities from Memcache. An entity key is always unique.