开发者

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

开发者 https://www.devze.com 2023-01-25 07:46 出处:网络
I’m looking to use the GAE Datastore directly, without using JDO/JPA.I have a quick question: Suppose I have this code:

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

精彩评论

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