gae-datastore

Google App Engine: Memcache or Static variable?

Well, I think I have a very basic doubt here: I'm developing an app on GAE (Java) and performing a query to the datastore that returns a lot of entities, so I need to cache it. I was using memcache and it was working great, but if I keep the list of entities in a static variable, the whole request goes as twice as fast than using memca...

Complex Class Hierarchy in Google AppEngine (Java)

Is it possible to have multiple classes that inherit/extends same class in Google AppEngine with Java (GAE/J) for my entities (JDO). For example I have: Content (Abstract class) Course and then my Course will have : list of Video that is extends Content list of Books At the same time Video has list of...

Which DB Does Google AppEngine Eclipse Plugin Uses

Which database does the Google AppEngine Eclipse plugin use? How do I view local_db.bin file which is in war/WEB-INF/appengine-generated. Is it SQLLite ? ...

Object is blank after getting it from Google Datastore

I asked question before asking if it is possible to save complex class composition in to the Google Datastore inside Google AppEngine with Java, but I was not clear enough and lazy to post all my class but after a lot of hours of struggle I start giving up. So here is more detailed question with the code. I know this kind of stuff shoul...

Exposing Entity IDs of Google Datastore data

Is it save to expose entity ids of data that is in Google Datastore. For example in my code i have entity with this id: @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String id; The id is going to be similar to this: agptZeERtzaWYvS...

Querying for N random records on Appengine datastore

Hi all, I'm trying to write a GQL query that returns N random records of a specific kind. My current implementation works but requires N calls to the datastore. I'd like to make it 1 call to the datastore if possible. I currently assign a random number to every kind that I put into the datastore. When I query for a random record I gen...

DataNucleus Enhancer flakey?

I'm creating a GWT app in Google App Engine, and using Google data store. Does anybody else have the problem of the DataNucleus being flakey as all get out? I can save a class, and DataNucleus will do it's thing just fine. If I change ANYTHING in the class (even adding whitespace) and then save, I get the following error: DataNucle...

Google DataStore not storing child objects

I have an entity Course that has a key to another entity (Document) inside. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") public class Course{ @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; @Persistent private Key document; public Document getDocume...

Google DataStore Unowned One-to-Many Relationships

So, I'm using google datastore for my GWT app and my coworker came up with an interesting question that I don't have the answer to. What happens to the set of keys when you delete some of the objects? For example, Person.java @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Person { @PrimaryKey @Persi...

Google DataStore Query Set

I have a Course entity which contains a Set of Keys to my Tag entity. How would I go about creating a query to get a list of courses with a specific tag? For example, I want to find all the courses tagged with java. Here are my entities: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable="true") public class Cou...

App Engine: How to "reset" the datastore?

Whell, I'm developing in app engine (java) and after a lot of tries and deployments, I need to "reset" the datastore. There is a lot of random data I added to test performance, and besides that the entities changed a lot, so I need to delete all: data, tables, indexes. How can I do that? Thanks :) ...

appengine: cached reference property?

How can I cache a Reference Property in Google App Engine? For example, let's say I have the following models: class Many(db.Model): few = db.ReferenceProperty(Few) class Few(db.Model): year = db.IntegerProperty() Then I create many Many's that point to only one Few: one_few = Few.get_or_insert(year=2009) Many.get_or_inser...

How to get the distinct value of one of my models in Google App Engine

I have a model, below, and I would like to get all the distinct area values. The SQL equivalent is select distinct area from tutorials class Tutorials(db.Model): path = db.StringProperty() area = db.StringProperty() sub_area = db.StringProperty() title = db.StringProperty() content = db.BlobProperty() rating =...

Google app engine tutorial problem - new datastore model

So i've just finished the google app engine greetings tutorial. All well so far. I then decided to try and add a new datastore model and then set it in the existing handler. I added a 2nd content field called "content2" and then tried to set it in the handler Guestbook(), but it keeps borking out. I'm sure it will be the silliest error, ...

App Engine: 13 StringPropertys vs. 1 StringListProperty (w.r.t. indexing/storage and query performance)

Hi all, A bit of background first: GeoModel is a library I wrote that adds very basic geospatial indexing and querying functionality to App Engine apps. It is similar in approach to geohashing. The equivalent location hash in GeoModel is called a 'geocell.' Currently, the GeoModel library adds 13 properties (location_geocell__n_, n=1.....

Query strange behaviour. Google App Engine datastore.

I have a model like this: class Group(db.Model): name = db.StringProperty() description = db.TextProperty() Sometimes when executing queries like: groups = Group.all().order("name").fetch(20) or groups = Group.all() I'm getting error massages like this: Traceback (most recent call last): File "/opt/google_appengine/google/a...

Is there any tool to backup/restore Google Datastore entities?

I've playing around with Google App Engine and Google Datastore for a while now and I am facing the need to take regular backups of my stuff up on the cloud. Is there any sort of general purpose tool that allows you to download all your data from a specific instance of google-datastore and restore it to another one? If so, please enlig...

How to store regular expressions in the Google App Engine datastore?

Regular Expressions are usually expressed as strings, but they also have properties (ie. single line, multi line, ignore case). How would you store them? And for compiled regular expressions, how to store it? Please note that we can write custom property classes: http://googleappengine.blogspot.com/2009/07/writing-custom-property-classe...

Creating alternative login to Google Users for Google app engine

How does one handle logging in and out/creating users, without using Google Users? I'd like a few more options then just email and password. Is it just a case of making a user model with the fields I need? Is that secure enough? Alternatively, is there a way to get the user to log in using the Google ID, but without being redirected to ...

Is it possible to update an entry on Google App Engine datastore through the object's dictionary?

I tried the following code and it didn't work: class SourceUpdate(webapp.RequestHandler): def post(self): id = int(self.request.get('id')) source = Source.get_by_id(id) for property in self.request.arguments(): if property != 'id': source.__dict__[property] = self.request.get(property) source.put() se...