Search Results

Search found 888 results on 36 pages for 'gae datastore'.

Page 8/36 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • Loading child entities with JPA on Google App Engine

    - by Phil H
    I am not able to get child entities to load once they are persisted on Google App Engine. I am certain that they are saving because I can see them in the datastore. For example if I have the following two entities. public class Parent implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String key; @OneToMany(cascade=CascadeType.ALL) private List<Child> children = new ArrayList<Child>(); //getters and setters } public class Child implements Serializable{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true") private String key; private String name; @ManyToOne private Parent parent; //getters and setters } I can save the parent and a child just fine using the following: Parent parent = new Parent(); Child child = new Child(); child.setName("Child Object"); parent.getChildren().add(child); em.persist(parent); However when I try to load the parent and then try to access the children (I know GAE lazy loads) I do not get the child records. //parent already successfully loaded parent.getChildren.size(); // this returns 0 I've looked at tutorial after tutorial and nothing has worked so far. I'm using version 1.3.3.1 of the SDK. I've seen the problem mentioned on various blogs and even the App Engine forums but the answer is always JDO related. Am I doing something wrong or has anyone else had this problem and solved it for JPA?

    Read the article

  • Getting Partial / No Redundancy on VM's created on latest datastore

    - by Germano
    Hi, First some background. I'm in the process of upgrading my ESX servers from 3.5 to vSphere 4 and so far I have setup the new vCenter Server. Before I start the upgrade of the ESX, I needed more storage so I created 3 datastores from available space on my Equallogic PS6000 which has been connected for a while so as far as connectivity, nothing has changed. but now here's my problem, I get a "Partial / No Redundancy" on any VM that I create in any of these new datastores. I can create VM's on any of the older datstores on LUN's from exactly the same Equallogic and it works fine, but not the new ones. Keep in mind that these new datastores are the only ones that were created under the new vCenter, so I believe it must have something to do with it. Is anyone aware of any issues about creating datastored using the new vCenter but on a 3.5 ESX host? ISCSI with QLogic QLE406x Thanks in advance for nay help. Germano

    Read the article

  • Custom DataAnnotation attribute with datastore access in ASP.NET MVC 2

    - by mare
    I have my application designed with Repository pattern implemented and my code prepared for optional dependency injection in future, if we need to support another datastore. I want to create a custom validation attribute for my content objects. This attribute should perform some kind of datastore lookup. For instance, I need my content to have unique slugs. To check if a Slug already exist, I want to use custom DataAnnotation attribute in my Base content object (instead of manually checking if a slug exists each time in my controller's Insert actions). Attribute logic would do the validation. So far I have come up with this: public class UniqueSlugAttribute : ValidationAttribute { private readonly IContentRepository _repository; public UniqueSlugAttribute(ContentType contentType) { _repository = new XmlContentRepository(contentType); } public override bool IsValid(object value) { if (string.IsNullOrWhiteSpace(value.ToString())) { return false; } string slug = value.ToString(); if(_repository.IsUniqueSlug(slug)) return true; return false; } } part of my Base content class: ... [DataMember] public ContentType ContentType1 { get; set; } [DataMember] [Required(ErrorMessageResourceType = typeof (Localize), ErrorMessageResourceName = "Validation_SlugIsBlank")] [UniqueSlug(ContentType1)] public string Slug { get { return _slug; } set { if (!string.IsNullOrEmpty(value)) _slug = Utility.RemoveIllegalCharacters(value); } } ... There's an error in line [UniqueSlug(ContentType1)] saying: "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type." Let me explain that I need to provide the ContentType1 parameter to the Constructor of UniqueSlug class because I use it in my data provider. It is actually the same error that appears if you try do to this on the built-in Required attribute: [Required(ErrorMessageResourceType = typeof (Localize), ErrorMessageResourceName = Resources.Localize.SlugRequired] It does not allow us to set it to dynamic content. In the first case ContentType1 gets known at runtime, in the second case the Resources.Localize.SlugRequired also gets known at runtime (because the Culture settings are assigned at runtime). This is really annoying and makes so many things and implementation scenarios impossible. So, my first question is, how to get rid of this error? The second question I have, is whether you think that I should redesign my validation code in any way?

    Read the article

  • Reg Google app engine datastore -primarykey

    - by megala
    hi, I created table in google Big table datastore ,In that the i set primary key using @annotations as follows @Id @Column(name = "groupname") private String groupname; @Basic private String groupdesc; I worked corretly,but it override the previous record,how to solve this for eg if i entered groupname=group1 groupdesc=groupdesc than it accept after that i enter same groupname it override previous record for eg groupname=group1 groupdesc=groups this record override previous one.

    Read the article

  • "Content is not allowed in prolog" when parsing perfectly valid XML on GAE

    - by Adrian Petrescu
    Hey guys, I've been beating my head against this absolutely infuriating bug for the last 48 hours, so I thought I'd finally throw in the towel and try asking here before I throw my laptop out the window. I'm trying to parse the response XML from a call I made to AWS SimpleDB. The response is coming back on the wire just fine; for example, it may look like: <?xml version="1.0" encoding="utf-8"?> <ListDomainsResponse xmlns="http://sdb.amazonaws.com/doc/2009-04-15/"> <ListDomainsResult> <DomainName>Audio</DomainName> <DomainName>Course</DomainName> <DomainName>DocumentContents</DomainName> <DomainName>LectureSet</DomainName> <DomainName>MetaData</DomainName> <DomainName>Professors</DomainName> <DomainName>Tag</DomainName> </ListDomainsResult> <ResponseMetadata> <RequestId>42330b4a-e134-6aec-e62a-5869ac2b4575</RequestId> <BoxUsage>0.0000071759</BoxUsage> </ResponseMetadata> </ListDomainsResponse> I pass in this XML to a parser with XMLEventReader eventReader = xmlInputFactory.createXMLEventReader(response.getContent()); and call eventReader.nextEvent(); a bunch of times to get the data I want. Here's the bizarre part -- it works great inside the local server. The response comes in, I parse it, everyone's happy. The problem is that when I deploy the code to Google App Engine, the outgoing request still works, and the response XML seems 100% identical and correct to me, but the response fails to parse with the following exception: com.amazonaws.http.HttpClient handleResponse: Unable to unmarshall response (ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog.): <?xml version="1.0" encoding="utf-8"?> <ListDomainsResponse xmlns="http://sdb.amazonaws.com/doc/2009-04-15/"><ListDomainsResult><DomainName>Audio</DomainName><DomainName>Course</DomainName><DomainName>DocumentContents</DomainName><DomainName>LectureSet</DomainName><DomainName>MetaData</DomainName><DomainName>Professors</DomainName><DomainName>Tag</DomainName></ListDomainsResult><ResponseMetadata><RequestId>42330b4a-e134-6aec-e62a-5869ac2b4575</RequestId><BoxUsage>0.0000071759</BoxUsage></ResponseMetadata></ListDomainsResponse> javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,1] Message: Content is not allowed in prolog. at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source) at com.sun.xml.internal.stream.XMLEventReaderImpl.nextEvent(Unknown Source) at com.amazonaws.transform.StaxUnmarshallerContext.nextEvent(StaxUnmarshallerContext.java:153) ... (rest of lines omitted) I have double, triple, quadruple checked this XML for 'invisible characters' or non-UTF8 encoded characters, etc. I looked at it byte-by-byte in an array for byte-order-marks or something of that nature. Nothing; it passes every validation test I could throw at it. Even stranger, it happens if I use a Saxon-based parser as well -- but ONLY on GAE, it always works fine in my local environment. It makes it very hard to trace the code for problems when I can only run the debugger on an environment that works perfectly (I haven't found any good way to remotely debug on GAE). Nevertheless, using the primitive means I have, I've tried a million approaches including: XML with and without the prolog With and without newlines With and without the "encoding=" attribute in the prolog Both newline styles With and without the chunking information present in the HTTP stream And I've tried most of these in multiple combinations where it made sense they would interact -- nothing! I'm at my wit's end. Has anyone seen an issue like this before that can hopefully shed some light on it? Thanks!

    Read the article

  • Fetching just the Key/id from a ReferenceProperty in App Engine

    - by ozone
    Hi SO, I could use a little help in AppEngine land... Using the [Python] API I create relationships like this example from the docs: class Author(db.Model): name = db.StringProperty() class Story(db.Model): author = db.ReferenceProperty(Author) story = db.get(story_key) author_name = story.author.name As I understand it, that example will make two datastore queries. One to fetch the Story and then one to deference the Author inorder to access the name. But I want to be able to fetch the id, so do something like: story = db.get(story_key) author_id = story.author.key().id() I want to just get the id from the reference. I do not want to have to deference (therefore query the datastore) the ReferenceProperty value. From reading the documentation it says that the value of a ReferenceProperty is a Key Which leads me to think that I could just call .id() on the reference's value. But it also says: The ReferenceProperty model provides features for Key property values such as automatic dereferencing. I can't find anything that explains when this referencing takes place? Is it safe to call .id() on the ReferenceProperty's value? Can it be assumed that calling .id() will not cause a datastore lookup?

    Read the article

  • What is the difference between .get() and .fetch(1)

    - by AutomatedTester
    I have written an app and part of it is uses a URL parser to get certain data in a ReST type manner. So if you put /foo/bar as the path it will find all the bar items and if you put /foo it will return all items below foo So my app has a query like data = Paths.all().filter('path =', self.request.path).get() Which works brilliantly. Now I want to send this to the UI using templates {% for datum in data %} <div class="content"> <h2>{{ datum.title }}</h2> {{ datum.content }} </div> {% endfor %} When I do this I get data is not iterable error. So I updated the Django to {% for datum in data.all %} which now appears to pull more data than I was giving it somehow. It shows all data in the datastore which is not ideal. So I removed the .all from the Django and changed the datastore query to data = Paths.all().filter('path =', self.request.path).fetch(1) which now works as I intended. In the documentation it says The db.get() function fetches an entity from the datastore for a Key (or list of Keys). So my question is why can I iterate over a query when it returns with fetch() but can't with get(). Where has my understanding gone wrong?

    Read the article

  • Spring GAE/J Could Not find API version error

    - by Julie Paltrow
    Hello, I am trying to use Spring MVC 3 on GAE/J and I got this error and I do not know what it means, does anybody have an idea and perhaps give me pointers on how to fix this? May 21, 2010 9:50:23 AM com.google.appengine.tools.info.LocalVersionFactory getVersion INFO: Could not find API version from /opt/home/me/workspace/SpringMVC/war/WEB-INF/lib/.svn java.util.zip.ZipException: error in opening zip file at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:114) at java.util.jar.JarFile.<init>(JarFile.java:133) at java.util.jar.JarFile.<init>(JarFile.java:97) at com.google.appengine.tools.util.ApiVersionFinder.findApiVersion(ApiVersionFinder.java:37) at com.google.appengine.tools.info.LocalVersionFactory.getVersion(LocalVersionFactory.java:65) at com.google.appengine.tools.info.UpdateCheck.getLocalVersion(UpdateCheck.java:112) at com.google.appengine.tools.info.UpdateCheck.checkForUpdates(UpdateCheck.java:91) at com.google.appengine.tools.info.UpdateCheck.doNagScreen(UpdateCheck.java:164) at com.google.appengine.tools.info.UpdateCheck.maybePrintNagScreen(UpdateCheck.java:132) at com.google.appengine.tools.development.DevAppServerMain$StartAction.apply(DevAppServerMain.java:150) at com.google.appengine.tools.util.Parser$ParseResult.applyArgs(Parser.java:48) at com.google.appengine.tools.development.DevAppServerMain.<init>(DevAppServerMain.java:113) at com.google.appengine.tools.development.DevAppServerMain.main(DevAppServerMain.java:89)

    Read the article

  • Restful authentication between two GAE apps.

    - by user259349
    Hello everyone, i am trying to write a restful google app engine application (python) that accepts requests only from another GAE that i wrote. I dont like any of the ways that i thought of to get this done, please advice if you know of something better than: Get SSL setup, and simply add the credentials on the request that my consuming app will send. I dont like it cause SSL will slow things down. Security by obsecurity. Add a random number in my request that is in Xmod0, where X is a secret number that both applications know. I just,,,, dont like this. Check the HTTP header to see where is the request coming from. This option is the one that i hate the least, not alot of processing, and spoofing an HTTP request is not really worth it, for my application's data. Is there any other clean solution for this?

    Read the article

  • chess AI for GAE

    - by Richard
    I am looking for a Chess AI that can be run on Google App Engine. Most chess AI's seem to be written in C and so can not be run on the GAE. It needs to be strong enough to beat a casual player, but efficient enough that it can calculate a move within a single request (less than 10 secs). Ideally it would be written in Python for easier integration with existing code. I came across a few promising projects but they don't look mature: http://code.google.com/p/chess-free http://mariobalibrera.com/mics/ai.html

    Read the article

  • GAE, JDO, count() doesn't work ?

    - by NilsBor
    On GAE with Spring/JDO after saving 2 entities (in transaction). On calling getById - entities fetched from data storage. On calling getCount() returns "0" and - on calling getAll() - returns empty collection. plz help me ! DAO: @Override public Long getCount() { return ((Integer) getJdoTemplate().execute(new JdoCallback() { @Override public Object doInJdo(PersistenceManager pm) throws JDOException { Query q = pm.newQuery(getPersistentClass()); q.setResult("count(this)"); return q.execute(); } })).longValue(); } @Override public void saveOrUpdate(T entity) { getJdoTemplate().makePersistent(entity); } @Override public List getAll() { return new ArrayList(getJdoTemplate().find(getPersistentClass())); }

    Read the article

  • Django version in GAE

    - by Alex
    I'm tring to use Django 1.1 in GAE, But when I uncomment use_library('django', '1.1') in this script import os os.environ['DJANGO_SETTINGS_MODULE'] = 'settings' from google.appengine.dist import use_library #use_library('django', '1.1') # Google App Engine imports. from google.appengine.ext.webapp import util # Force Django to reload its settings. from django.conf import settings settings._target = None import django.core.handlers.wsgi import django.core.signals import django.db import django.dispatch.dispatcher # Unregister the rollback event handler. django.dispatch.dispatcher.disconnect( django.db._rollback_on_exception, django.core.signals.got_request_exception) def main(): # Create a Django application for WSGI. application = django.core.handlers.wsgi.WSGIHandler() # Run the WSGI CGI handler with that application. util.run_wsgi_app(application) if __name__ == "__main__": main() I receives AttributeError: 'module' object has no attribute 'disconnect' What is going on?

    Read the article

  • How do i redirect to a GET request from a POST request on GAE

    - by user259349
    Hello everyone, i am writing an FBML app on facebook hosted in GAE. Facebook will talk to your hosted app only vai POST (im sure this is the cause, but please do correct me if i'm wrong). So im faced with the issue that inside of my POST method, i need to redirect to facebook OAuth authroize URL. But i can only send a GET request. How can i do that? At the moment i'm doing class OauthHandler(webapp.RequestHandler): def post(self): # blablablab request.redirect(oauth_uri) Which is wrong since the oauth_uri is only responding to GET. Further more, OAuth will redirect back to my redirect handler through GET, but i cant! i can only do post. So i'm confused. ideas? Thanks in advance

    Read the article

  • Techniques to avoid DeadlineExceededException in GAE/J?

    - by Tahir Akram
    I am developing an Twitter4J web application in Google App Engine/Java. I need to show two lists. One is Twitter friends and other is followers. With photo and screen name. It is working fine for people who have 20-30 followers and friends. But it gave me DeadlineExceededException when I try a user who has 150+ followers and friends. GAE throws this exception if web request take time more than 30 seconds. So what techniques I can adopt to avoid this exception. Should I generate two AJAX calls for each of my list. After page loads. So that every call will have its own 30 secs limit? Or what else you think? I am gone make it. Please help.

    Read the article

  • Design for tagging system in GAE-J

    - by tempy
    I need a simple tagging system in GAE-J. As I see it, the entity that is being tagged should have a collection of keys referring to the tags with which it's associated. A tag entity should simply contain the tag string itself, and a collection of keys pointing to the entities associated with the tag. When an entity's list of tags is altered, the system will create a new tag if the tag is unknown, and then append the entity's key to that tag's key collection. If the tag already exists, then the entity's key is simply appended to the tag's key collection. This seems relatively straight-forward and uncontroversial to me, but I would like some feedback on this design, just to be sure.

    Read the article

  • JQuery cookie access has stopped working for GAE app

    - by Greg
    I have a google app engine app that has been running for some time, and some javascript code that checks for a login cookie has suddenly stopped working. As far as I can tell, NO code has changed. The relevant code uses the jquery cookies plugin (jquery.cookies.2.2.0.min.js)... // control the default screen depending // if someone is logged in if( $.cookies.get('dev_appserver_login') != null || $.cookies.get('ACSID') != null ) { alert("valid cookie!") $("#inventory-container").show(); } else { alert("INvalid cookie!") $("#welcome-container").show(); } The reason for the two checks is that in the GAE SDK, the cookies are named differently. The production system uses 'ACSID'. This if statement works in the SDK and now fails 100% of the time in production. I have verified that the cookie is, in fact, present when I inspect the page. Thoughts?

    Read the article

  • Exposing a "dumbed-down", read-only instance of a Model in GAE

    - by Blixt
    Does anyone know a clever way, in Google App Engine, to return a wrapped Model instance that only exposes a few of the original properties, and does not allow saving the instance back to the datastore? I'm not looking for ways of actually enforcing these rules, obviously it'll still be possible to change the instance by digging through its __dict__ etc. I just want a way to avoid accidental exposure/changing of data. My initial thought was to do this (I want to do this for a public version of a User model): class ReadOnlyUser(db.Model): display_name = db.StringProperty() @classmethod def kind(cls): return 'User' def put(self): raise SomeError() Unfortunately, GAE maps the kind to a class early on, so if I do ReadOnlyUser.get_by_id(1) I will actually get a User instance back, not a ReadOnlyUser instance.

    Read the article

  • PHP app.yaml, new to GAE, not sure of how to setup

    - by chetweewax
    I have a single page website built on bootstrap 3, that I am trying to move to Google Apps Engine. I Scaffold my sites using php, and all the content is showing but not the styles and javascript. My site is basically set up as follows _/js/bootstrap.js _/js/custom.js _/fonts/glypicon ...etc _/css/bootstrap.css _/css/custom.css _/php/ .. all my php files go here ... index.php can someone help me setup my app.yaml for this? I am new to GAE, and am a little confused by this.

    Read the article

  • Timeout loading application on GAE using web2py

    - by Charles P.
    I am uploading an app to GAE. Through some experimentation I've found that if I don't include wsgihandler.py, the app loads very slowly. It feels like it's looking for this file and them timing out. Besides the slow loading, everything works perfectly without wsgihandler.py, so I want to know if there is a simple way to remove the references to the file. I tried poking around the files, but it doesn't look like there are direct references. Also, I asked before what I need at a minimum to get an application to work, and I found that I need: web2py/app.yaml web2py/gaehandler.py web2py/VERSION web2py/gluon/* (and subfolders, this is web2py) web2py/applications/theoneappyouwanttodeploy/* (and subfolders)

    Read the article

  • unable to add objects to saved collection in GAE using JDO

    - by Jeffrey Chee
    I have a ClassA containing an ArrayList of another ClassB I can save a new instance of ClassA with ClassB instances also saved using JDO. However, When I retrieve the instance of Class A, I try to do like the below: ClassA instance = PMF.get().getPersistenceManager().GetObjectByID( someid ); instance.GetClassBArrayList().add( new ClassB(...) ); I get an Exception like the below: Uncaught exception from servlet com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.. So I was wondering, Is it possible to add a new item to the previously saved collection? Or was it something I missed out. Best Regards

    Read the article

  • GAE images.resize with fixed proportional crop

    - by user288541
    I need to resize and crop to exactly 60x80px from various size and aspect ratio. Just before i put into Datastore. Anyone already got this issue resolved. Currently i already succed to just transform it to exact height (80px) with various width which nott look so good when i try to display it on a list. e.g jcaroussel. My db.put code is like bellow: if users.get_current_user(): personal.personal_id = int(self.request.get('personal_id')) personal.name = self.request.get('name') personal.latitude = self.request.get('latitude') personal.info = self.request.get('info') photo = images.resize(self.request.get('img'), 0, 80) personal.photo = db.Blob(photo) personal.lc_id = int(self.request.get('lc_id')) personal.put() self.redirect('/admin/personal') else: self.response.out.write('I\'m sorry, you don\'t have permission to add this LP Personal Data.') I just want to do similar result when we upload our avatar on google talk/google chat. Anyone solved this? Thx

    Read the article

  • Send a "304 Not Modified" for images stored in the datastore

    - by Emilien
    I store user-uploaded images in the Google App Engine datastore as db.Blob, as proposed in the docs. I then serve those images on /images/<id>.jpg. The server always sends a 200 OK response, which means that the browser has to download the same image multiple time (== slower) and that the server has to send the same image multiple times (== more expensive). As most of those images will likely never change, I'd like to be able to send a 304 Not Modified response. I am thinking about calculating some kind of hash of the picture when the user uploads it, and then use this to know if the user already has this image (maybe send the hash as an Etag?) I have found this answer and this answer that explain the logic pretty well, but I have 2 questions: Is it possible to send an Etag in Google App Engine? Has anyone implemented such logic, and/or is there any code snippet available?

    Read the article

  • Use Google AppEngine datastore outside of AppEngine project

    - by Holtwick
    For my little framework Pyxer I would like to to be able to use the Google AppEngine datastores also outside of AppEngine projects, because I'm now used to this ORM pattern and for little quick hacks this is nice. I can not use Google AppEngine for all of my projects because of its's limitations in file size and number of files. A great alternative would also be, if there was a project that provides an ORM with the same naming as the AppEngine datastore. I also like the GQL approach very much, since this is a nice combination of ORM and SQL patterns. Any ideas where or how I might find such a solution? Thanks.

    Read the article

  • unable to add objects to saved collection in GAE

    - by Jeffrey Chee
    I have a ClassA containing an ArrayList of another ClassB I can save a new instance of ClassA with ClassB instances also saved using JDO. However, When I retrieve the instance of Class A, I try to do like the below: ClassA instance = PMF.get().getPersistenceManager().GetObjectByID( someid ); instance.GetClassBArrayList().add( new ClassB(...) ); I get an Exception like the below: Uncaught exception from servlet com.google.appengine.api.datastore.DatastoreNeedIndexException: no matching index found.. So I was wondering, Is it possible to add a new item to the previously saved collection? Or was it something I missed out. Best Regards

    Read the article

< Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >