开发者

Google AppEngine datastore config: reusable?

开发者 https://www.devze.com 2023-03-25 02:39 出处:网络
The documentation about datastore config objects confuses me: \"A configuration object can be used any number of times. You must开发者_如何学C create a separate configuration object for each datasto

The documentation about datastore config objects confuses me:

"A configuration object can be used any number of times. You must开发者_如何学C create a separate configuration object for each datastore call that uses it." (from AppEngine doc)

So can I do something like this:

config = db.create_config(deadline=5)
db.put(someModels, config=config)
db.delete(someKeys, config=config)

Or do I have to do something like this:

config = db.create_config(deadline=5)
db.put(someModels, config=config)
config = db.create_config(deadline=5)
db.delete(someKeys, config=config)

?

Thanks


That is a left-over from when config options were changed by creating a RPC. Each RPC could be used only once. The new datastore Configuration objects can be used multiple times; parameters are now read from them and passed on.

For reference, when settings were passed by creating RPC objects the docs read:

An RPC object can only be used once. You must create a separate RPC object for each datastore call that uses it.

0

精彩评论

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