开发者

java.lang.UnsupportedOperationException thrown when getObjectById() called

I have an entity with a Key set as follows:

KeyFactory.Builder keyBuilder = new KeyFactory.Builder(MyClass.class.getSimpleName(), "uniqueString");
Key = keyBuilder.getKey();

To fetch an entity by key I reconstruct the key in the exact same way and call getObjectById() as follows;

App app = pm.getObjectById(MyClass.clas开发者_JAVA百科s, keyBuilder.getKey());

Most of the time this works fine but at certain times getObjectById throws this error:

java.lang.UnsupportedOperationException

Does anyone know what causes this? I realise this seems like a very vague problem I've described here but that's really all I know. It's so strange it seems like it may even be a bug with App Engine.


Could the issue be the same as this one, which seems may be a bug in the GAE code? If it is the same, some users have posted work-arounds to the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜