开发者

Does Google App Engine datastore.get(key) always return the same entity-object?

I’m looking to use the GAE Datastore directly, without using JDO/JPA. I have a quick question:

Suppose I have this code:

Key key = getMyKey ();
Entity entity1 = dataStore.get (key);
Entity entity2 = dataStore.get (key);

Are entity1 and entity2 guaranteed to be the same object (i.e. entity1 == entity2), or can calls to get using the same key return different Entity instances?

Thanks!

EDIT

Is the behavious different if the get operations are executed wi开发者_如何学编程thin a transaction?


Fetches will return different entity instances, even if there are no modifications between the two calls.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜