google-cloud-datastore

Using Objectify to concurrently write data on GAE

半腔热情 提交于 2020-01-05 16:57:31
问题 Let's for example say I have the following objectify model: @Cache @Entity public class CompanyViews implements Serializable, Persistence { @Id private Long id; private Date created; private Date modified; private Long companyId; ........ private Integer counter; ........ @Override public void persist() { persist(false); } @Override public void persist(Boolean async) { ObjectifyService.register(Feedback.class); // setup some variables setUuid(UUID.randomUUID().toString().toUpperCase());

Objectify BATCH delete has no effect

你说的曾经没有我的故事 提交于 2020-01-05 09:15:27
问题 I have a DAO below, with a transactional delete per entity and in batch . Deleting one entity at a time works just fine. Batch delete has NO effect whatsoever : the code below is simple and straightforward IMO, but the call to deleteMyObjects(Long[] ids) - which calls delete(Iterable keysOrEntities) of Objectify - has no effect ! public class MyObjectDao { private ObjectifyOpts transactional = new ObjectifyOpts().setBeginTransaction(true); private ObjectifyOpts nonTransactional = new

Objectify BATCH delete has no effect

一世执手 提交于 2020-01-05 09:15:22
问题 I have a DAO below, with a transactional delete per entity and in batch . Deleting one entity at a time works just fine. Batch delete has NO effect whatsoever : the code below is simple and straightforward IMO, but the call to deleteMyObjects(Long[] ids) - which calls delete(Iterable keysOrEntities) of Objectify - has no effect ! public class MyObjectDao { private ObjectifyOpts transactional = new ObjectifyOpts().setBeginTransaction(true); private ObjectifyOpts nonTransactional = new

Google Cloud Search API - is there a limit to number of document puts per second?

戏子无情 提交于 2020-01-05 07:18:13
问题 With the Google Cloud Search API is there a limit or restriction to how many documents you can add to a search index per second? I know the Search API is great for querying and scales well that way, but what about many individual document puts per second? Would using a unique index for each document put improve performance? The reason I ask is because of an application I will be building that will have many Datastore puts with one respective Search document put right after the Datastore

Google DataStore with objectify - composite queries on HashMap

六眼飞鱼酱① 提交于 2020-01-05 05:46:06
问题 I am using Google App Engine for my REST service backend and Google dataStore as the DB and objectify for accessing datastore. One of the properties in my entity is Map<String,String> customAttrs; This is because I don't know before hand what all parameters can come from the client. My requirement is that I want to be able to index on these parameters in the HashMap. I looked at the following question: GAE w/ Objectify - Can you query a HashMap? and tried out what was mentioned in the

Add properties to Google Datastore entity dynamically

情到浓时终转凉″ 提交于 2020-01-05 04:07:13
问题 I have a below use case: I have a method that accepts a list of strings. For each of the strings, I need to create a property under an existing google data store entity A Example: I have an existing entity Person with properties fname and lname . If the input list has strings - address , city , I need to update the entity Person to include these new properties address and city . I'm coding this use case in Python. Any suggestions on how I can achieve this? 回答1: So the best way to do this is

cloudBackend.setCredential not setting createdBy/updatedBy/owner properties of CloudEntity

北战南征 提交于 2020-01-05 02:32:09
问题 I am using mobile backend starter and I am trying to update an entity when using the secured by id setting. I keep getting the error com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unauthorized { "code": 401, "errors": [ { "domain": "global", "location": "Authorization", "locationType": "header", "message": "Insuffient permission for updating a CloudEntity: CE:123456 by: USER:123456", "reason": "required" } ], "message": "Insuffient permission for updating a CloudEntity

Google App Engine (datastore) - will a deleted key regenerate?

老子叫甜甜 提交于 2020-01-04 14:15:24
问题 I've got a simple question about datastore keys . If I delete an entity, is there any possibility that the key will be created again? or each key is unique and can be generated only one-time? Thanks. 回答1: It is definitely possible to re-use keys. Easy to test, for example using the datastore admin page: create an entity for one of your entity models using a custom/specified key name and some property values delete the entity create another one using the same key name and different property

How can I test the validity of a ReferenceProperty in Appengine?

时间秒杀一切 提交于 2020-01-04 06:22:30
问题 I am currently testing a small application I have written. I have not been sufficiently careful in ensuring the data in my datastore is consistent and now I have an issue that I have some records referencing objects which no longer exist. More specifially, I have some objects which have ReferenceProperty's which have been assigned values; the objects referred to have been deleted but the reference remains. I would like to add some checks to my code to ensure that referenced objects exist and

“=” symbols in GAE TextProperty

青春壹個敷衍的年華 提交于 2020-01-04 05:40:08
问题 I'm getting strange additional symbols (=) in text property when adding text there via POST. For example: The team is back with an unstoppable fury as they are being chased by the p= olice, Alonzo and Yuuma. Vinnie, Shorty and Kiro=92s skills will be put to = the test. There shouldn't be any of = symbols in that text. My co de is: class FileUploadHandler(blobstore_handlers.BlobstoreUploadHandler): def post(self): game_file = self.get_uploads()[1] screen_file = self.get_uploads()[0] if not