objectify

Python lxml (objectify): Xpath troubles

╄→гoц情女王★ 提交于 2019-12-11 08:25:37
问题 I am attempting to parse an xml document, extracting data using lxml objectify and xpath. Here is a snip of the document: <?xml version="1.0" encoding="UTF-8"?> <Assets> <asset name="Adham"> <pos> <x>27913.769923</x> <y>5174.627773</y> </pos> <description>Ba bla bla</description> <bar>(null)</bar> </general> </asset> <asset name="Adrian"> <pos> <x>-179.477707</x> <y>5286.959359</y> </pos> <commodities/> <description>test test test</description> <bar>more bla</bar> </general> </asset> </Assets

periodically delete entries in objectify

不羁的心 提交于 2019-12-11 06:33:58
问题 I'm using Google App Engine with Objectify and would like to delete some entries in the db every 5 minutes. What would be the best way to accomplish this? Should I use Google App Engine's ThreadManager or a cron job? Or is there another way? 回答1: Cron sounds like fitting the requirement here, but I'm worried about the scale of entities that need to be deleted. (Up to a few hundred thousands every five minutes according to the comments). Deleting that many entities takes a considerable amount

Remote API, Objectify and the DevServer don't like transactions?

眉间皱痕 提交于 2019-12-11 06:26:07
问题 I am using objectify 4 to write to the HRD datastore. Everything works fine in unit tests and running the application in devserver or production. But when I try connect using the REMOTE API to the devserver datastore, an error is thrown when the code starts a XG transaction. While connecting with the Remote API, it seems to think that HRD is not enabled. This is how I connect ... public static void main(String[] args) { RemoteApiOptions options = new RemoteApiOptions().server("localhost",

Spring Security ACL on App Engine Datastore

只愿长相守 提交于 2019-12-11 02:12:08
问题 We are using Spring Security ACL infrastructure in conjuction with App Engine Datastore. We do not use low-level Datastore API but rather we use Objectify framework to access Datatstore. We need to transform Spring Security ACL model (suitable for RDBMS) into model more suitable for schema-less object-oriented Datastore. So far we have ended up with two entities described below. Acl id: Long domainObject: Key (ancestor/parent) entries: List<AclEntry> (embedded) owner: String AclEntry sid:

How to return a list of custom objects on Objectify

痴心易碎 提交于 2019-12-11 01:28:15
问题 I'm working on an Android project which uses Google App Engine for backend as described here: Using Android & Google App Engine on Android Studio. I have some model classes on the backend side like User and Item, and I'm trying to return a list of Items user has. public List<Ref<Item>> getItems() { return items; } When I try to Sync Project with Gradle Files , I get this error: Error:Execution failed for task ':backend:appengineEndpointsGetClientLibs'. There was an error running endpoints

How to enable Objectify XA transaction?

走远了吗. 提交于 2019-12-10 19:53:54
问题 I'm implementing friendship functionality between entities of same type Profile . This entity kind is root (non parent) entity. A Profile has a Set<Ref<Profile>> field named friends and it's getter getFriends() . Here the code: public boolean makeFriends(final Profile profile1, final Profile profile2) { final Ref<Profile> profileRef1 = Ref.create(profile1); final Ref<Profile> profileRef2 = Ref.create(profile2); boolean result = false; // test to avoid useless transaction if (!profile1

Only Ancestor queries are allowed inside transactions, how to deal with it?

北城余情 提交于 2019-12-09 10:10:36
问题 I need to do a query inside a Transaction , however I don't know the Entity @Id, what I have is a value of a field, like a username but not the ID, So in other words, I can't create a Key to do the query. How can I do a query to get an Entity inside a Transaction ? 回答1: Without delving into deeper design issues, there are really two options: 1) Run the query outside of a transaction. Objectify (which you tagged this post with) makes it easy to execute non-transactional queries even while

Java datastore write performance: Objectify vs. JPA

ε祈祈猫儿з 提交于 2019-12-09 03:41:25
I ran two five minute long simple benchmarks against the datastore. One used the JPA implementation on top of Datanucleus provided by Google and the other used Objectify for persistence. Each request created 10 new indexed entities with the same 9 fields, each using another datatype. To avoid any effects by the network connection the benchmark returned the timespan between the start and the end of 10 writes. AVG Median 10% 90% 99% JPA 76.5 76 53 98 114 Objectify 41.1 40 39 43 57 Objectify TX 50.6 50 44 60 69 As you can see using Objectify is much faster than JPA. Are there any performance

How many objects is “too many” for in a single transaction to Google's DataStore (High Replication)?

跟風遠走 提交于 2019-12-08 16:56:53
问题 I have following entity (non-relevant fields/methods are removed). public class HitsStatsTotalDO { @Id transient private Long targetId; public Key<HitsStatsTotalDO> createKey() { return new Key<HitsStatsTotalDO>(HitsStatsTotalDO.class, targetId); } } So... I'm trying to do batch get for 10 objects for which I construct keys using HitsStatsTotalDO.createKey() . I'm attempting to fetch them in transaction like this: final List<Key<HitsStatsTotalDO>> keys = .... // This is being called in

Using Android & Google App Engine on Android Studio

懵懂的女人 提交于 2019-12-08 08:20:46
问题 I'm developing an app with backend and I decided to try using Google App Engine for my backend. Since I'm really new on Google App Engine, I'm little bit confused with the logic. Basically, I have a couple of model classes to represent my object types. Lets say one of them is User and another is Item. Users have items and an item can belong more than one user. So User X can have 25 items including Item A, and User Y can have totally different 20 items and also the Item A. Right now my User