gae-datastore

Can I define a read-only transaction using GAE's JDO?

I'm use the latest versions of the GWT GAE w/ JDO stack. I have a task queue updating persistent objects with the datastore. I also have a gwt user interface displaying the save objects (without modification). Given tightly defined transaction (start/commit) boundaries. Is there a way for me to define a read-only transaction for the GUI...

how to retry/recover from a java.sql.SQLexception: Concurrent Modification

Using JDO on GAE, I'm using a simple database transaction code block like below. What is a good way to retry/recover from a thrown java.sql.SQLException: Concurrent Modification? private final Provider pmp; ... PersistenceManager pm = pmp.get(); try { pm.currentTransaction().begin(); MyObject myObject= pm.getObjectById(MyObject.c...

Google App Engine Datastore query problem

Hi to all, I have the following problem: I'd like to retrieve all products of a category class Category(emodel): name = db.StringProperty() class Channel(emodel): name = db.StringProperty() category = db.ReferenceProperty(Category,collection_name="cat_set") class Product(emodel): name = db.StringProperty() ...

Need a way to count entities in GAE datastore that meet a certain condition? (over 1000 entities)

I'm building an app on GAE that needs to report on events occurring. An event has a type and I also need to report by event type. For example, say there is an event A, B and C. They occur periodically at random. User logs in and creates a set of entities to which those events can be attributed. When the user comes back to check the stat...

App Engine Java advance query types

I realize there are a lot of questions already on here about querying the App Engine Datastore, but I want to get opinions on my particular case. I'm querying scores to build a high score table, so I want them ordered by score descending. Now, it is possible for two scores to have the same score value, so paging through based on this va...

Unable to access ID property from a datastore entity

Using Google App Engine SDK and Python, I'm facing an issue : I'm unable to access the ID property of a given entity properties. The only properties I can access are those defined in my class Model, plus the key property (see answer below) : class Question(db.Model): text = db.StringProperty() answers = db.StringListProperty() ...

write too frequent ,datastore contention timeout

I read app engine wiki, on datastore contention if too frequent write more than 5 times in 1 seconds. The wiki introduced use "shard" approach" as workaround. May i know if we use spring @transactional on this, this can prevent datastore contention timeout right since writing in done concurrently ? ...

jdo google datastore range execute exception

SELECT FROM Foo WHERE sort < sortParam PARAMETERS String sortParam ORDER BY sort RANGE 15,16 where there are less then 15 objects throws a java.lang.IllegalStateException exception. Do I just need to catch that exception to handle the case when there are fewer then 15 records, or is there something else going on that I'm...

Use a db.StringProperty() as unique identifier in Google App Engine

Hi, I just have a hunch about this. But if feels like I'm doing it the wrong way. What I want to do is to have a db.StringProperty() as a unique identifier. I have a simple db.Model, with property name and file. If I add another entry with the same "name" as one already in the db.Model I want to update this. As of know I look it up w...

app-engine (python) Modeling relationships, am I doing it wrong?

Using the following models I am trying to figure out a way to generate a news feed of sorts so that when a user logs in they are presented with a list of upcoming events for bars that they choose to follow. Will I be able to query something like “SELECT * FROM Barevent WHERE parent_bar IN UserprofileInstance.following”? If so will this b...

AppEngine 'explicitly cancelled' error.

I'm using Google AppEngine and the deferred library, with the Mapper class, as described here (with some improvements as in here). In some iterations of the mapper I get the following error: CancelledError: The API call datastore_v3.Put() was explicitly cancelled. The Mapper usually runs fine, I used to have a higher batch size, so th...

Casting Entity into it's class type on App Engine

I have the Entity object and I want to get the object. Currently, I'm using PersistenceManager.getObjectById(Object.class, Entity.getId()); The problem with this is that it is an extra call to the datastore when all of the properties are already available in the Entity. ...

How to create JPA application in eclipse

How to create a JPA application using Google's datastore in Eclipse? What are the steps to create a Google App Engine application in Eclipse? ...

Need beginner's explanation for the difference between using a parent-entity relationship versus ReferenceProperty

In regards to this statement in Google's app-engine doc: "Only use entity groups when they are needed for transactions. For other relationships between entities, use ReferenceProperty properties and Key values, which can be used in queries." can someone give an example of a query of say getting all the players that are member of the sa...

google app engine Bigtable

I have doubt using jpa. I defined the datanucleus connection for MYSQL as follows. datanucleus.ConnectionDriverName=com.mysql.jdbc.Driver datanucleus.ConnectionURL=jdbc:mysql://localhost/myDB datanucleus.ConnectionUserName=... datanucleus.ConnectionPassword=.. My constraint is if I want to connect to google app engine datastore(ie Big...

Online storage: Google Spreadsheet v.s. GAE Bigtable

As an online storage, two of them can be a choice, with officially supported API. Both of them have its advantage and weakness. Google SpreadSheet supports RSS feed, but has limited no. of rows. GAE Bigtable is more scalable, but harder to be remotely accessed by external party. Any other comparison? and what's your favorite? ...

a way to convert appengine datastore Entity to my object?

Using google appengine 1.3.0 w/ java and jdo... While trying to write JDO querys for 1-to-many owned relationships, I came across a non-JDO concept that I thought was really smart. Ancestor Querys. The appengine.api.datastore.Query interface allows for scoping of a query using the parent Key. Unfortunately the results from the query ar...

Local App Engine datastore is slow once loaded up, any suggestions?

I've loaded up a local datastore with 40,000+ entries. Unfortunately, recalling any data from it at all is very slow on my fairly new Macbook Pro. Any suggestions on speeding things up, short of buying a new piece of hardware? ...

What is the best way to do AppEngine Model Memcaching?

Currently my application caches models in memcache like this: memcache.set("somekey", aModel) But Nicks' post at http://blog.notdot.net/2009/9/Efficient-model-memcaching suggests that first converting it to protobuffers is a lot more efficient. But after running some tests I found out it's indeed smaller in size, but actually slower ...

Using Property Builtin with GAE Datastore's Model

I want to make attributes of GAE Model properties. The reason is for cases like to turn the value into uppercase before storing it. For a plain Python class, I would do something like: Foo(db.Model): def get_attr(self): return self.something def set_attr(self, value): self.something = value.upper() if value != None...