[appengine-java] Re: Problems with entity groups in transactions
Hi, I think at this point that Max's knowledge is needed Max could you report on this thread please??? Thanks datanucleus wrote: Perhaps GAE/J doesn't respect that metadata extension tag then. Raise a bug on their DataNucleus plugin for it. Not related to JDO but... parent-child relationships are really simple to define with Twig... you don't need to use keys at all. FWIW You don't need "Key"s ***in JDO*** at all either ... when the JDO interface is respected and implementation details don't leak out into user space; keys should not be presented to the user IMHO. JDO is then a very good option whether you want your code to run on another platform or not. -- Patrizio Munzi Product Specialist Viale Bruno Buozzi, 19 - 00197 Roma (Italy) tel: +39 06 4543 3540 fax: +39 06 4543 3587 mobile: +39 393 7195 164 mail: patrizio.mu...@eris4.com web: http://www.eris4.com skype: eris4_munzi --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Problems with entity groups in transactions
2009/11/2 datanucleus andy_jeffer...@yahoo.com FWIW You don't need Keys ***in JDO*** at all either ... when the JDO interface is respected and implementation details don't leak out into user space; keys should not be presented to the user IMHO. JDO is then a very good option whether you want your code to run on another platform or not. You must use Keys in your model objects, no? I would call this user space as the user must still write this code. Sure you can write extra code to abstract this away but frameworks should really do this for you. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: JDO Best Practices
DM - http://vike.googlecode.com/svn/trunk/vike/src/br/com/ximp/vike/server... Judging from above you don't use JPO but low level API. But your entity class (Actor) is dressed with JDO annotations. I don't know what will happen if entity dressed with JPA annotiation and beautified by JDO enhancer will be persisted by low level API skipping JDO layer. If you use JDO annotation use JDO API to manage your entities: http://code.google.com/intl/pl/appengine/docs/java/gettingstarted/usingdatastore.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Issue with com.google.appengine.api.datastore.Text?
Thanks, It is working. Is this an issue? Or is it specific to Text On Nov 3, 11:00 am, Rusty Wright rwright.li...@gmail.com wrote: What happens if you change @Persistent to @Persistent(defaultFetchGroup = true) ? Tito George wrote: Enviornment: Local I have a Text field in one Persistent capable object, @Persistent private com.google.appengine.api.datastore.Text event_Description; I am sure that i am not setting null into this field. But while operating on queried object event_Description.getValue() is throwing NullPointerException. I am quering like this. public static MapLong, Event getEvents(AppUser appUser){ PersistenceManager pm = PMF.getInstance().getPersistenceManager(); Query query = pm.newQuery(Event.class); query.setFilter(email == pEmail); query.declareParameters(String pEmail); ListEvent result = null; MapLong, Event eventsMap = null; try { result = (ListEvent) query.execute(appUser.getEmail()); eventsMap = new HashMapLong, Event(); for(Event e: result){ //LINE TO REPLACE eventsMap.put(e.getEvent_ID(), e); } } finally { pm.close(); query.closeAll(); } return eventsMap; } Its works fine if I replace above commented line(//LINE TO REPLACE) with String str = e.getEvent_Description(); or sop(e.getEvent_Description()); or e.getEvent_Description(); Any Comments??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: very high error rate (88%) receiving XMPP no error msg in the log !
anyone else facing same problem ? my app's today's error rate is 94% (of 832) ! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Data Store Indexes
Also, I updated my datastore-indexes.xml as the following: ?xml version=1.0 encoding=utf-8? datastore-indexes xmlns=http://appengine.google.com/ns/datastore-indexes/1.0; autoGenerate=true datastore-index kind=MDsIri ancestor=false property name=iri direction=asc / property name=name direction=asc / property name=image direction=asc / property name=iriLowerCase direction=asc / property name=nameLowerCase direction=asc / /datastore-index /datastore-indexes I changed the kind from com.col.server.MDsIri to MDsIri. It still produced No results. I cannot test it on Development Server -- please let me know if there is a way to test it locally.. I uploaded it and only tested it on the (deployed) App Engine. My app id is http://foafan2000.appspot.com/ On Nov 2, 7:49 pm, Pion onlee2...@gmail.com wrote: Thanks Jason. I tried the following: SELECT __key__ FROM MDsIri Also, SELECT * FROM MDsIri No more error. But it returns No results. The Data Viewer shows that I have many entities. http://code.google.com/appengine/docs/python/datastore/gqlreference.html shows the following syntax: SELECT [* | __key__] FROM kind [WHERE condition [AND condition ...]] [ORDER BY property [ASC | DESC] [, property [ASC | DESC] ...]] [LIMIT [offset,]count] [OFFSET offset] Why didn't I get any result? On Nov 2, 4:15 pm, Jason (Google) apija...@google.com wrote: Yes, that is the correct doc for the Java indexes. Regarding your GQL query, the name of the kind is not the full name of the class (including the package) but the simple name. So try using MDsIri instead of com.col.server. MDsIri. You should be able to see any entities you saved in the data viewer and the valid kind names are provided in the drop down. - Jason On Fri, Oct 30, 2009 at 12:05 PM, Pion onlee2...@gmail.com wrote: I found this http://code.google.com/appengine/docs/java/datastore/queriesandindexe... with the following example: ?xml version=1.0 encoding=utf-8? datastore-indexes xmlns=http://appengine.google.com/ns/datastore-indexes/1.0; autoGenerate=true datastore-index kind=Person ancestor=false property name=lastName direction=asc / property name=height direction=desc / /datastore-index /datastore-indexes But I still cannot solve my query error. On Oct 30, 9:34 am, Pion onlee2...@gmail.com wrote: I just deployedmy app to the GAE for the first time. I went to the Admin Console - DataStore - Indexes which says, You have not created indexes for this application. Some types of queries require an index to be built. You can manage your indexes in an index.yaml file. Learn more abouthttp:// code.google.com/appengine/kb/general.html#indexes . http://code.google.com/appengine/kb/general.html#indexeslinkstohttp:// code.google.com/appengine/docs/python/datastore/queriesandinde It seems to be Python specific. What's the corresponding one on Java? It seems to be on war\WEB-INF \appengine-generated\datastore-indexes.xml. Please correct me if I am wrong. My datastore-indexes.xml is empty. ?xml version=1.0 encoding=utf-8? datastore-indexes autoGenerate=true /datastore-indexes Also, I didi the following: o Go to the Admin Console - DataStore - Data Viewer. It displays my low-level datastore contents. o Click the Query (using GQL). It displays SELECT * FROM com.col.server.MDsIri automatically by default. o Click Run Query button o It says, Invalid GQL query string. I suspect because I do not have any indexes yet. What are the syntax to populate datastore-indexes.xml so I can do the above query. Thanks in advance for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: ClassCastException after changing PK from Long to String
Hi Jason, thank you very much for your answer. I think that you are right, but have to admit, that I cannot prove it. I have tested the application again after some time (browser has been closed in between), and everything worked fine. Is it possible, that sessions (javax.servlet.http.HttpSession) are not being killed between application deployments? I have deleted the data in my datastore via the Admin Console, just as you proposed, and no data had been left. But I remember one instance of this persistent object in the session (although I thought I would detach it from the datastore), and that could have been the one that caused this problem. I would very much appreciate the information, if the session data is being kept alive between deployments and if I can delete those as well. Thanks a lot! Greetings, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: RPC SerializationException if detachable=true
A simple search on this forum for GWT and detachable should give plenty of links ... as to why GWT doesn't cope seamlessly with standard bytecode-enhanced classes. Also http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/3c768d8d33bfb1dcseems http://timepedia.blogspot.com/2009/04/google-appengine-and-gwt-now-marriage.html and project Gilead (in SourceForge) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: XSLT Version
See http://groups.google.com/group/google-appengine-java/browse_thread/thread/9c9fb88e1b175395/f8f9a9adcfeb044f?lnk=gstq=xslt#f8f9a9adcfeb044f and you see that saxon works with App Engine And Saxon support XSLT 2 So, with Saxon, App Engine supports XSLT 2 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Dev server datastore deadlock
I can reproduce the deadlock and I believe I have a fix. I'm not sure if it will make the next release though. Can you please file an issue so we can track this? Thanks, Max On Sat, Oct 31, 2009 at 4:31 PM, stumpy ianmcgrath.m...@gmail.com wrote: I removed the thread dump doc because the servlet code denomstrates the problem. On Oct 29, 8:20 pm, Jason (Google) apija...@google.com wrote: Thanks for the snippet. The thread dump isn't appearing for me in the Google Doc -- can you try posting it again and verifying that it's publicly viewable? - Jason On Wed, Oct 28, 2009 at 2:27 AM, stumpy ianmcgrath.m...@gmail.com wrote: The thread dump is a bit cryptic so I reduced the problem down to a small servlet that fails. Use the servlet below in the development environment and set up aync requests to it and a deadline will occur e.g. using 2 or more looped curls from the terminal. public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { DatastoreService ds = DatastoreServiceFactory.getDatastoreService(); Transaction t = ds.beginTransaction(); try { Key key = KeyFactory.createKey(entity_kind, 1); Entity e = new Entity(key); e.setProperty(property_bytes, new Blob(new byte[100])); ds.put(t, e); t.commit(); } catch (Throwable th) { if (t.isActive()) { t.rollback(); } } } On Oct 27, 6:12 pm, stumpy ianmcgrath.m...@gmail.com wrote: http://docs.google.com/Doc?docid=0AV6jRtzB1ZNYZGNtNWdxemZfNjNkYjVkajl... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Object not persisted JDO
Hi Julio. How are you verifying that the entity is not persisted? Are you querying for it or verifying using the data viewer? If you're not using the data viewer, please try this first -- http://localhost:8080/_ah/admin(substitute your port number for 8080). If you don't see your entities in the data viewer, can you post your source for the PersistenceCapable objects and the code you're using to persist them? - Jason On Mon, Nov 2, 2009 at 6:31 AM, Julio Faerman jfaer...@gmail.com wrote: Hi, I am trying to persist an object using JDO, but the object is not beeing persisted to the datastore. Can anyone please help me understand why? Here is what i can see in the logs from the moment i .makePersistent() to the point EM is closed: [DataNucleus.Persistence] - Making object persistent : br.com.ximp.vike.server.model.games.ww.ac...@1392743 [DataNucleus.Cache] - Object br.com.ximp.vike.server.model.games.ww.ac...@1392743 (id=org.datanucleus.identity.identityrefere...@6506f0) added to Level 1 cache (loadedFlags=[YYY]) [DataNucleus.Transaction] - Outstanding nontx update being committed to datastore [DataNucleus.Transaction] - Transaction created [DataNucleus Transaction, ID=Xid= --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: managing root / parent objects
The overhead of having to fetch the inner object is negligible since you're using a direct fetch by key. You can set a @NotPersistent property of the intended type and modify your DAO methods to fetch both objects (User and FavoriteFood) and set the @NotPersistent property of the User to this fetched object. It's a few extra lines but you get the convenience of being able to access the inner object directly without polluting your datastore with cloned objects. - Jason On Sat, Oct 31, 2009 at 4:21 PM, Rusty Wright rwright.li...@gmail.comwrote: Yes, that's the point. My thinking is that (correct me if I'm wrong) if I store the object's key, when I fetch the outer containing object that has its key, I'll need to use the key to fetch the object. By cloning it, I don't need to do that, I just fetch the outer object and the inner object will get fetched along with it (assuming it's in the default fetch group). Whenever I want the outer object I'll also want its inner objects. If I store the key in the outer object, when I fetch the outer object it seems to me that I'll then need to fetch the contained object. And I'll have two fields on the outer object; using my FavoriteFood example, I'll need a field favoriteFoodKey, type Key, which is persisted, and a favoriteFood, type FavoriteFood, which is transient, and not persisted. Then my jsp would use the getter for the favoriteFood field. This is why I'm asking; it seems a bit complicated. Perhaps there's a simpler way that I could use. In my case, there isn't a lot of data so the duplication of objects isn't a big issue. John Patterson wrote: Why are you cloning instead of setting the original object? JDO will store the clone as a separate entity in the datastore. 2009/11/1 Rusty Wright rwright.li...@gmail.com mailto:rwright.li...@gmail.com I'm trying to figure out the best way to manage root objects that are used with different objects. For a semi concrete example, suppose you have a web page with a drop down list of Favorite Foods, and a User object may have a reference to a FavoriteFood, and other objects will have references to FavoriteFood objects as well. It seems to me that if individual FavoriteFood objects don't change, but the list (table) of FavoriteFood objects can grow, you could make them Cloneable and use the clone, making it a child, for example: FavoriteFood fav = favoriteFoodDao.findByStringId(stringId); user.addFavoriteFood(fav.clone()); Google's examples usually (always?) store the subordinate object's Key rather than a clone of the object. I can see problems with using clones; even though I'm sure they won't, they may change. Similarly, items may need to be deleted from the master FavoriteFood list/table. There may be other problems that I haven't thought of. Anyhow, I'm wondering if others have gone done this road or investigated it and can offer advise. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Inequality operator is !=, but can we add
not-equal filters are not supported in the current SDK unless you're doing not equal null, in which case we just turn it into null because the datastore considers null to be smaller than any non-null value. You can read about the supported filter types here: http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html In the forthcoming SDK not-equal filters will be supported (along with IN filters). Max On Sat, Oct 31, 2009 at 8:34 AM, Dave Cheong d...@davecheong.com wrote: And public void myMethod2() { Query query = entityManager.createQuery(select o from Myclass o where o.title = :p1 and o.myProperty :p2); // bind params query.getResultList(); // exception thrown unexpectedly also } On Nov 1, 3:32 am, Dave Cheong d...@davecheong.com wrote: The relevant code snippets are: In MyServiceImpl - @Repository @Transactional public MyServiceImpl ... { protected EntityManager entityManager; public void myMethod() { Query query = entityManager.createQuery(select o from Myclass o where o.title = :p1 and o.myProperty != :p2); // bind params query.getResultList(); // exception thrown unexpectedly } @PersistenceContext public void setEntityManager(EntityManager entityManager) { this.entityManager = entityManager; } } In applicationContext.xml - !-- JPA EntityManagerFactory -- bean id=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean p:persistenceUnitName=main/ !-- Transaction manager for a single JPA EntityManagerFactory (alternative to JTA) -- bean id=transactionManager class=org.springframework.orm.jpa.JpaTransactionManager p:entityManagerFactory-ref=entityManagerFactory/ In persistence.xml - persistence-unit name=main providerorg.datanucleus.store.appengine.jpa.DatastorePersistenceProvider / provider properties property name=datanucleus.NontransactionalRead value=true/ property name=datanucleus.NontransactionalWrite value=true/ property name=datanucleus.ConnectionURL value=appengine/ /properties /persistence-unit Any help you provide is appreciated. thanks, dave On Nov 1, 3:23 am, Dave Cheong d...@davecheong.com wrote: What I'm saying is I'm using EMF and writing JPQL and is not working, which it should since it is the valid operator for inequality. Are you saying it works for you? dave On Nov 1, 12:27 am, datanucleus andy_jeffer...@yahoo.com wrote: 1). I can't seem to get != working either. I have no such problems with JDOQL, but then you're using it in GAE/J with an old version of DataNucleus. 2) If I have mapped my objects using JPA annotations, will the query engine default to JDOQL vs JPQL? The type of metadata specification ... JDO XML, JDO Annotations, JPA XML, JPA Annotations ... has nothing to do with the persistence API being used (in DataNucleus). If you create a PMF then you use JDO API, if you create an EMF then you use JPA API. JPA API only allows JPQL queries (you can't use JDOQL). JDO API allows JDOQL or JPQL queries, using the API to define what you're using; see the JDO javadocs. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: SimpleDS: an alternative for Datastore persistence
Great! Since someone else is now using this besides me, I've added more comments. Also, I've added some testcases and fixed an issue when invoking put() with entities that contain partial keys. If your entities don't have complete keys when invoking put(), you should go get the latest code. Let me know if you run into any problems, or have suggestions for improvements. Vince On Mon, Nov 2, 2009 at 10:47 PM, Roy Smith roy.smith@googlemail.com wrote: Hi Vince Thanks for sharing. I've modified my persistence framework to incorporate your class and it works very well. kind regards Roy --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: AccessControlException on DatastoreService.put() method
Do you see any other exceptions under WARNING or ERROR that provides more information? How long do you wait before the exception is thrown? If it's close to 30 seconds, you could be experiencing a timeout, and you can try scaling back the number of entities written (500 is the theoretical max but depending on the size of the entities and the responsiveness of the datastore, you may not be able to hit this count in every request). - Jason On Sat, Oct 31, 2009 at 8:30 AM, Pion onlee2...@gmail.com wrote: I got the AccessControlException on the following code snippet: public void add(ListString iriList, ListString nameList, ListString imageList) { // deleted for brevity try { datastore.put(eList); // The log below shows this line as at com.col.server.MDsIri.add(MDsIri.java:74) } catch (IllegalArgumentException exIA) { logger.severe(IllegalArgumentException when trying to datastore.put. Exception message: + exIA.getMessage()); } catch (ConcurrentModificationException exCM) { logger.severe(ConcurrentModificationException when trying to datastore.put. Exception message: + exCM.getMessage()); } catch (Exception ex) { logger.severe(Exception when trying to datastore.put. Exception message: + ex.getMessage()); // the log (last line) below says that the message is unknown } } // deleted for brevity } I follow the guideline that the eList has only 500 entities at most as mentioned on http://code.google.com/appengine/docs/java/datastore/overview.html#Quotas_and_Limits . Also, I don't call any thread or system threads as mentioned on http://code.google.com/appengine/docs/java/runtime.html#The_Sandbox. I did not get the error below on my Development Server. I don't know how to interpret the error because the exception/error message is Unknown(last line of the log). I appreciate any help. Log from the Google Apple Engine Admin Console - Main - Logs 10-31 09:06AM 07.119 com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue $SystemLoader loadFinalizer: Not allowed to access system class loader. I 10-31 09:06AM 07.145 com.google.appengine.repackaged.com.google.common.base.internal.Finalizer getInheritableThreadLocalsField: Couldn't access Thread.inheritableThreadLocals. Reference finalizer threads will inherit thread local values. I 10-31 09:06AM 07.148 com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue init: Failed to start reference finalizer thread. Reference cleanup will only occur when new references are created. java.lang.reflect.InvocationTargetException at com.google.appengine.runtime.Request.process-69e6389d93ef7f72 (Request.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Method.java:40) at com.google.appengine.repackaged.com.google.common.base.FinalizableReferenceQueue.init (FinalizableReferenceQueue.java:124) at com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools $WeakInterningPool.clinit(InterningPools.java:104) at com.google.appengine.repackaged.com.google.common.labs.misc.InterningPools.newWeakInterningPool (InterningPools.java:48) at com.google.appengine.repackaged.com.google.io.protocol.ProtocolSupport.clinit (ProtocolSupport.java:55) at com.google.apphosting.api.DatastorePb$PutRequest.freeze (DatastorePb.java:8452) at com.google.apphosting.api.DatastorePb$PutRequest$1.init (DatastorePb.java:8367) at com.google.apphosting.api.DatastorePb$PutRequest.clinit (DatastorePb.java:8364) at com.google.appengine.api.datastore.DatastoreServiceImpl.put (DatastoreServiceImpl.java:155) at com.google.appengine.api.datastore.DatastoreServiceImpl.put (DatastoreServiceImpl.java:147) at com.col.server.MDsIri.add(MDsIri.java:74) // please see the code snippet above at com.col.server.tool.DsWriter.writeIri(DsWriter.java:73) at com.col.server.CAdmin.doIriWriteIri(CAdmin.java:165) at com.col.server.CAdmin.doGet(CAdmin.java:60) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java: 487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter (ServletHandler.java:1093) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter
[appengine-java] Re: UnsupportedDatastoreFeatureException
Multiple calls to setFilter will overwrite the previous value. Do you really want to do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] memcache in hosted mode?
There are a few threads that mention using memcache in hosted mode, and having to set certain properties or configure persistence.xml, but there does not seem to be a concrete example of what / where / or how to set the parameters. Currently I have to redeploy my app to App Engine every time to see a change on the servlet, because it uses memcache and my hosted mode is not supporting it. Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Java namespace for entity in bulkloader?
I am using Nick's excellent tutorials on bulk loading, and was able to push a huge pile of entities up to production. Problem is, they looked like this: MySpecialEntity in my custom python bulkloader class and in production. The gotcha is my application is Java, and queries for: SELECT FROM org.domain.app.MySpecialEntity fail because the Java namespace was not part of the python bulkloader. Anyone know a workaround? Stuart --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Maximum data size of image sent to service is not 1Mb, but 512Kb?
Hi Esteban. Please file any discrepancies between the development and production environments as bugs in the public issue tracker: http://code.google.com/p/googleappengine/issues/list Can you attach or link to an image that I can use to reproduce the error? Thanks, - Jason On Sat, Oct 31, 2009 at 10:41 AM, Esteban Ignacio Masoero emaso...@getsense.com.ar wrote: Hi there: I am using the ImagesService as this page ( http://code.google.com/intl/en/appengine/docs/java/images/overview.html ) says, using exactly the code posted there, and found out that with images between 512Kb (aprox.) and 1Mb, a strange error occurs. Moreover, the exception thrown does not have the same text description (I asume this in particular has to do with the differences that still exist between development and production environment). Image: .png, 581Kb Development: Caused by: java.lang.IllegalArgumentException: Failed to read image at com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:65) (...) Production: Caused by: java.lang.IllegalArgumentException: Unknown at com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:65) (...) This error is different that the one that occurs when an 1Mb image is processed, which correctly says The request to API call images.Transform() was too large.. I tried with an .png/466Kb image, and it worked fine in both environments. I think we have two different issues here, the different error messages in dev/prod environments, and the apparently real restriction size, which seems to be 512Kb aprox. Has anyone had the same problem? What can google guys say about this? Thanks in advance, Esteban PD = the 581Kb png image was edited with mspaint to reach that size, would that have something to do with it? (I succesfully visualized in firefox browser, so think it's ok, but I mention it just in case) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: PreparedQuery.countEntities() clarifications
I think you already arrived the recommended solution to the issue of counting entities. For reference, the reason that the production environment only returned at most 1,000 is an artifact of the query mechanism that App Engine uses which can only return up to 1,000 results per query. - Jason On Fri, Oct 30, 2009 at 9:07 AM, Pion onlee2...@gmail.com wrote: http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/PreparedQuery.html#countEntities%28%29 shows int countEntities() Retrieves the number of Entities that currently match this Query. I have the following method: protected int count(String kind) { Query query = new Query(kind); PreparedQuery preparedQuery = datastore.prepare(query); return preparedQuery.countEntities(); } On my Development Server, it returns the total number of the entities which is over 40,000 entities. But when deploying it on GAE, it always returns 1,000 entities. Is this because of this limitation http://code.google.com/appengine/docs/java/datastore/overview.html#Quotas_and_Limits ? If so, what is the best way to find total number of entities I have? Please correct me if my assumption is incorrect. Thanks in advance for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: task queue limit 30 sec?
Hi Steve. Can you post the full stack trace of one of these exceptions? - Jason On Mon, Nov 2, 2009 at 4:30 AM, sproz stephane.spra...@gmail.comwrote: Meanwhile, could anyone let me know why I get these DeadlineExceededException ? Thanks, Steve www.sprosys.com On Oct 29, 9:55 pm, Jason (Google) apija...@google.com wrote: We'll get these reflected in the documentation very soon. - Jason On Wed, Oct 28, 2009 at 12:49 PM, Toby Reyelts to...@google.com wrote: The limits on tasks queues recently changed http://googleappengine.blogspot.com/2009/10/task-queue-quota-increase For example, the new total limit is 100K tasks/day for free apps and 1M default for billing enabled. On Wed, Oct 28, 2009 at 2:38 PM, Jason (Google) apija...@google.com wrote: All task queue quotas and limits are listed at http://code.google.com/appengine/docs/java/taskqueue/overview.html#Qu Note that you can currently insert up to 10,000 tasks per day, although billed applications may have a higher upper limit. - Jason On Tue, Oct 27, 2009 at 12:21 PM, James Cooper jamespcoo...@gmail.comwrote: Related question: Is there a limit to the number of pending tasks in a queue? Can you have a million items in there? thanks -- James On Oct 27, 12:07 pm, Jason (Google) apija...@google.com wrote: No, all individual tasks must complete in 30 seconds or less. For larger jobs, such as processing millions of entities, the recommended approach is to split these jobs and run them as multiple tasks. At the end of the current task, you can determine if more work needs to be accomplished and dynamically add new tasks to the queue until the job is completely finished. - Jason On Sun, Oct 25, 2009 at 1:59 PM, sproz stephane.spra...@gmail.com wrote: Is the limit duration of a task in a queue superior to 30 seconds? I receive a DeadlineExceededException all the time --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] thanking uuuuuuuuu
Thank for the java version Is there any plugin for netbeans IDE --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: A tiny framework for working with POJO's in GAE
I don't see a link, but if your framework is open source, feel free to submit it to the App Engine open source projects listing by following the instructions at http://groups.google.com/group/google-appengine/web/google-app-engine-open-source-projects . - Jason On Sun, Nov 1, 2009 at 12:35 AM, Lars Borup Jensen lbor...@gmail.comwrote: Hi GAE users. I've written (well it's still in-progress) a tiny framework to make it easier to work with GAE/J and plain POJO's but not hiding the many traps of GAE (a transaction can only span a single entity-group and so forth). I've posted one of my simple JUnit testcases on my blog if anyone want to take a look: http://lborupj.blogspot.com/ Regards, Lars Borup Jensen --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] UnsupportedDatastoreFeatureException
I cant wrap my head around this but i'm having an issue with doing a basic query. I have a user class that contains an embeddable class ContactInfo. ContactInfo has email, phone, and address String fields. @PersistenceCapable(identityType=IdentityType.APPLICATION) public class MyUser { @Persistent private ContactInfo contactInfo; @PersistenceCapable @EmbeddedOnly public class ContactInfo { When i wrote a simple authenticate query... Query query = pm.newQuery(MyUser.class); query.setFilter(email == emailParam); query.setFilter(password == passwordParam); query.declareParameters(String emailParam,String passwordParam); try { ListMyUser results = (ListMyUser) query.execute (email,password); I can successfully get back results with no errors. I have another class called Account that i want to link a user to. @PersistenceCapable(identityType=IdentityType.APPLICATION) public class Account { @Persistent private Key accountManager; In adding an account i need to first get the user from a form via a query Query query = pm.newQuery(MyUser.class); query.setFilter(email == emailParam); query.declareParameters(String emailParam); try { ListMyUser results = (ListMyUser) query.execute(email); Notice this looks exactly the same as the other query just without the password. In this call i get this error. org.datanucleus.store.appengine.query.DatastoreQuery $UnsupportedDatastoreFeatureException: Problem with query SELECT FROM net.project.model.MyUser WHERE email == emailParam PARAMETERS String emailParam: Unexpected expression type while parsing query: org.datanucleus.query.expression.VariableExpression If i change the filter to query.setFilter(name == emailParam); this works fine. I suspect that since name is an object in MyUser while email is an object in ContactInfo that is embedded in MyUser, this is failing. But then how come the Authentication query worked? Any help would be appreciated... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Issue with com.google.appengine.api.datastore.Text?
Beats me. It seems to be some sort of pixie dust you'll often need to apply. You don't need it for String, Long, Date, and a variety of other jdk classes, but I think you will need it for your classes. I don't understand why it's not used in the GAE web site's documentation. Tito George wrote: Thanks, It is working. Is this an issue? Or is it specific to Text On Nov 3, 11:00 am, Rusty Wright rwright.li...@gmail.com wrote: What happens if you change @Persistent to @Persistent(defaultFetchGroup = true) ? Tito George wrote: Enviornment: Local I have a Text field in one Persistent capable object, @Persistent private com.google.appengine.api.datastore.Text event_Description; I am sure that i am not setting null into this field. But while operating on queried object event_Description.getValue() is throwing NullPointerException. I am quering like this. public static MapLong, Event getEvents(AppUser appUser){ PersistenceManager pm = PMF.getInstance().getPersistenceManager(); Query query = pm.newQuery(Event.class); query.setFilter(email == pEmail); query.declareParameters(String pEmail); ListEvent result = null; MapLong, Event eventsMap = null; try { result = (ListEvent) query.execute(appUser.getEmail()); eventsMap = new HashMapLong, Event(); for(Event e: result){ //LINE TO REPLACE eventsMap.put(e.getEvent_ID(), e); } } finally { pm.close(); query.closeAll(); } return eventsMap; } Its works fine if I replace above commented line(//LINE TO REPLACE) with String str = e.getEvent_Description(); or sop(e.getEvent_Description()); or e.getEvent_Description(); Any Comments??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: UnsupportedDatastoreFeatureException
Andy has pinpointed the issue. You most likely don't have a field on your MyUser class named email but the error isn't being triggered on the first query because your second call to setFilter() is overwriting the reference to the nonexistent field. You'll need to pass the entire filter to setfilter() and you most likely want 'contactInfo.email' instead of 'email' Hope this helps, Max On Tue, Nov 3, 2009 at 12:00 PM, datanucleus andy_jeffer...@yahoo.comwrote: Multiple calls to setFilter will overwrite the previous value. Do you really want to do that? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] How to obtain a consumer key to access a gmail account in a java based application
Hello everyone! I'm new to the Google API so my questions are gonna sound really easy :P I'm trying to integrate a simple service of getting a specific gmail user's contacts from his google account. Whats the most useful API google can provide for me to access such methods? Also, i realize that for a user to access google services though a client application, its necessary to obtain a consumer key for authentication. Can anyonw please explain me how can i get a consumer key so i can login to gmail through my client application? Thank you in advance --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: DeadlineExceededException while executing a server method.
Hi Sanjith. All App Engine requests must return within 30 seconds or this exception will be thrown. If you have a larger task, you can divide it into several parts and execute these in separate tasks, but each task must also return in 30 seconds or less. - Jason On Sat, Oct 31, 2009 at 11:12 AM, Sanjith Chungath csanj...@gmail.comwrote: in another word, is there a way to execute a server action through a normal server call or by tasks which can run more than 30 seconds? -Sanjith On Sat, Oct 31, 2009 at 12:40 AM, Sanjith Chungath csanj...@gmail.comwrote: Hi all, While executing a server method which talks to another system and get details from there, I get a DeadlineExceededException at the appengine. I don't have much control on the time taken by the other system. I just call a method from an interface of that system and wait for the response. What is the best practice in these situations? Below are the exceptions that I got at server. javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.lang.String com.sanchu.clicks.client.GreetingService.greetServer(java.lang.String)' threw an unexpected exception: com.google.apphosting.api.DeadlineExceededException: This request (e737f449255620d0) started at 2009/10/29 18:30:43.480 UTC and was still executing at 2009/10/29 18:31:12.207 UTC. at com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:360) at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:546) at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:166) at com.google.gwt.user.server.rpc.RemoteServiceServlet.doPost(RemoteServiceServlet.java:86) at javax.servlet.http.HttpServlet.service(HttpServlet.java:713) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363) at com.google.net.rpc.impl.Server$2.run(Server.java:814) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516) at com.google.net.rpc.impl.Server.startRpc(Server.java:769) at com.google.net.rpc.impl.Server.processRequest(Server.java:351) at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:437) at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319) at com.google.net.rpc.impl.RpcConnection.dataReceived(RpcConnection.java:290) at com.google.net.async.Connection.handleReadEvent(Connection.java:436) at
[appengine-java] Re: ClassCastException after changing PK from Long to String
Sessions are also stored in memcache. To clear this you can write a simple page that calls memcache.clearAll(); 2009/11/3 pgoetz pgo...@pgoetz.de Hi Jason, thank you very much for your answer. I think that you are right, but have to admit, that I cannot prove it. I have tested the application again after some time (browser has been closed in between), and everything worked fine. Is it possible, that sessions (javax.servlet.http.HttpSession) are not being killed between application deployments? I have deleted the data in my datastore via the Admin Console, just as you proposed, and no data had been left. But I remember one instance of this persistent object in the session (although I thought I would detach it from the datastore), and that could have been the one that caused this problem. I would very much appreciate the information, if the session data is being kept alive between deployments and if I can delete those as well. Thanks a lot! Greetings, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Problems with JDO Query.setCandidates(Collection)
App Engine's DataNucleus plugin doesn't support the setCandidates method for querying a select group of entities -- all queries currently target the full datastore. You're welcome to file a feature request in the datanucleus-appengine issue tracker, but this isn't likely to be prioritized in the very near future. I recommend finding another acceptable solution for now. Depending on the typical size of your result sets, you can sort in memory, for example. http://code.google.com/p/datanucleus-appengine/ - Jason On Fri, Oct 30, 2009 at 10:06 AM, Zach znconr...@gmail.com wrote: So I am trying to do 2 sequential queries in app-engine to get around the problem of only being able to primary sort on the property that an inequality is done on. The problem is that setCandidates(Collection) doesnt actually appear to set the candidates to query against. Pseudo- code below. Query ageQuery = persistenceManager.newQuery(PersistentObject.class); ageQuery.setFilter(age ageMax); ageQuery.declareParameters(Integer ageMax); QueryResult unsorted = ageQuery.execute(25); Query sortQuery = persistenceManager.newQuery(PersistentObject.class); sortQuery.setOrdering(dateCreated desc); sortQuery.setCandidates(unsorted); QueryResult sorted = sortQuery.execute(); Also, one can verify that setCandidates doesn't work with something like below Query query= persistenceManager.newQuery(PersistentObject.class); query.setCandidates(new ArrayList()); QueryResult sorted = qujery.execute(); because sorted.size()!=0. Has anyone else ran into this problem? Am i doing something wrong? Thanks in advance for the help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Maximum data size of image sent to service is not 1Mb, but 512Kb?
Jason: I've created this issue: http://code.google.com/p/googleappengine/issues/detail?id=2353, so you can have all the info you need to test both problems. Thanks again! Esteban On Tue, Nov 3, 2009 at 4:35 PM, Jason (Google) apija...@google.com wrote: Hi Esteban. Please file any discrepancies between the development and production environments as bugs in the public issue tracker: http://code.google.com/p/googleappengine/issues/list Can you attach or link to an image that I can use to reproduce the error? Thanks, - Jason On Sat, Oct 31, 2009 at 10:41 AM, Esteban Ignacio Masoero emaso...@getsense.com.ar wrote: Hi there: I am using the ImagesService as this page ( http://code.google.com/intl/en/appengine/docs/java/images/overview.html ) says, using exactly the code posted there, and found out that with images between 512Kb (aprox.) and 1Mb, a strange error occurs. Moreover, the exception thrown does not have the same text description (I asume this in particular has to do with the differences that still exist between development and production environment). Image: .png, 581Kb Development: Caused by: java.lang.IllegalArgumentException: Failed to read image at com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:65) (...) Production: Caused by: java.lang.IllegalArgumentException: Unknown at com.google.appengine.api.images.ImagesServiceImpl.applyTransform(ImagesServiceImpl.java:65) (...) This error is different that the one that occurs when an 1Mb image is processed, which correctly says The request to API call images.Transform() was too large.. I tried with an .png/466Kb image, and it worked fine in both environments. I think we have two different issues here, the different error messages in dev/prod environments, and the apparently real restriction size, which seems to be 512Kb aprox. Has anyone had the same problem? What can google guys say about this? Thanks in advance, Esteban PD = the 581Kb png image was edited with mspaint to reach that size, would that have something to do with it? (I succesfully visualized in firefox browser, so think it's ok, but I mention it just in case) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Master/Detail relations and redundant data handling
Sounds good James. The owned relationship between Book and Chapter is just defined by the fact that Book has a collection of Chapter as a member variable. If the relationship is bi-directional (i.e. Chapter has a Book as a member variable) then you use the mappedBy field in the @Persistent annotation. Looking foreward to youre feedback. On Nov 3, 2009 1:22 PM, James H james.hollier...@gmail.com wrote: Ok Bryce...I'm back. Going to test with your ideas now. In my case, I tend to avoid generic column names like id in favor of bookId and chapterId so I should not have any naming conflicts (at least rarely). Also, my FK embedded classes should not have any collections though I have a feeling they may come up as I get further into it. I'll just test with Book and owned relation Chapter as you have it here. How do we tell JDO whether a relation is owned vs unowned by the way? Because I would like to have a child object of each for the testing. Thanks! On Oct 9, 12:06 pm, bryce cottam bcot...@gmail.com wrote: FYI, this video was hugely helpful fo... On Fri, Oct 9, 2009 at 10:46 AM, James H james.hollier...@gmail.com wrote:Ylmz, thats how... ... read more »- Hide quoted text - - Show quoted text - --~--~-~--~~-... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Master/Detail relations and redundant data handling
Ok Bryce...I'm back. Going to test with your ideas now. In my case, I tend to avoid generic column names like id in favor of bookId and chapterId so I should not have any naming conflicts (at least rarely). Also, my FK embedded classes should not have any collections though I have a feeling they may come up as I get further into it. I'll just test with Book and owned relation Chapter as you have it here. How do we tell JDO whether a relation is owned vs unowned by the way? Because I would like to have a child object of each for the testing. Thanks! On Oct 9, 12:06 pm, bryce cottam bcot...@gmail.com wrote: FYI, this video was hugely helpful for me, and this information helps me decide how to structure my data model to run best on the app-engine, it's a Google I/O session on how the app-engine big table implementation works:http://www.youtube.com/watch?v=tx5gdoNpcZM On Fri, Oct 9, 2009 at 10:46 AM, James H james.hollier...@gmail.com wrote: Ylmz, thats how I see it too. Any significant data model will be riddled with FKs and since GAE datastore does not support Joins you have NO choice but to denormalize your data to meet the needs of your app queries. The Cottam Pattern above allows best management of source to accomplish this denormalization. I assume the simple example you are referring to either only stores the Keys in the physical table (which would be insufficient for app queries) or stores the whole record (which would be massive overkill). Does that make any sense? On Oct 8, 4:46 am, bryce cottam bcot...@gmail.com wrote: yes, I think the point that we are making is that we are trying to managed un-owned relationships :) You are describing owned relationships, which I use as well, but in many cases, I really want un-owned relationships. For a variety of reasons really, one of which is that the children I have in my collection get get rather big, and there is a cap on the number of writes that can happen on an entity group. So, in come cases it's better to model the relationships as foreign keys. The problem comes in when you try to manage your data. It's a pretty common suggestion from the app-engine team to denormalize, we're just trying to come up with a way to denormalize and minimize code duplication etc. Denormalizing will let you query better/faster etc. but can create headaches when trying to update a single field which is mirrored on several other entities. For instance, you could have an Employee that works for several departments in a company. It's the same Employee, so it should be a single record. So, in this case you'd have a Company, Division and Employee. A Company owns it's Divisions and it also owns it's Employees, yet a Division owns it's Employees as well. So, where does the collection of Employees live? On the Company, or the Division? If it's the Division, then you can't share employees with other divisions (unless you duplicate the Employee record). If the Company owns the Employee, then you have to make some way for the Division to know who's in it. You could do this by putting a collection of Division Key objects on an Employee record, or a collection of Employee Keys on a Division record. Yet, this doesn't allow for simple querying, like select all employees that work in a division located in New York and has less than 20 people in it. Or, select all divisions who have an employee named Fred. you can do queries like this if you denormalize the data though :) On Thu, Oct 8, 2009 at 3:35 AM, ylmz yilmazhuse...@gmail.com wrote: may I suggest different kind of desing http://code.google.com/appengine/docs/java/datastore/relationships.html, in this document it suggests to use collection types to design one to many relation ships. and it works pretty well actually. when you use a collection type. app engine does not really use the original colection type you used. instead it uses its own replacement. so if you want to add a new employee to the company you just add a new one to the list. it automatically added to datastore. and if I understand right, when you get a company you dont get all the employees inside. you only get a collection type which is actulally empty but look like it has employees inside. so when you get any element from collection type it pulls that record from datastore. there is also some collection types that excepts unique values. Is there a spesific reason you don't use collections that I didn't understand? On Oct 7, 4:16 am, James H james.hollier...@gmail.com wrote: Wow, this is majorly useful...can't wait to try it out!!! For the life of me I can't figure out why this problem domain has NOT already been exhausted in this Group since denormalization is a requirement with this technology for any significant business application! I believe your example should be
[appengine-java] Re: What defines a single transaction in JDO?
Can you try moving your query into the first transaction and report if this makes a difference? - Jason On Fri, Oct 30, 2009 at 7:10 PM, RoryD rory1doug...@gmail.com wrote: I'm aware of the restriction on operating on multiple entity groups in a single transaction, but I thought the following code would work (but it doesnt): Transaction tx = null; try { tx = pm.currentTransaction(); ClassA existing = getExistingByQuery(pm); if(existing != null) { // 1st transaction tx.begin(); existing.setStuff(yo); tx.commit(); if(existing.isDingBat()) { // 2nd transaction tx.begin(); ClassB other = new ClassB(); other.setStuff(wow); pm.makePersistent(other); // (***) tx.commit(); } } } catch (Exception e) { if(tx != null tx.isActive()) { tx.rollback(); } } However, I get an exception at the line marked (***): java.lang.IllegalArgumentException: can't operate on multiple entity groups in a single transaction. How do I get another transaction then? Do i need to create a new PersistenceManager for the second part? In this simplified example, I could forego the second transaction entirely, but that might not always be the case, so what's the general solution? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: task queue limit 30 sec?
Here's one I got a few days ago. It looks like it timed-out while just queuing up a task: Uncaught exception from servlet com.google.apphosting.api.DeadlineExceededException: This request (8b0dab1ffe61eb3f) started at 2009/10/31 16:30:47.041 UTC and was still executing at 2009/10/31 16:31:16.438 UTC. at sun.misc.Unsafe.park(Native Method) at java.util.concurrent.locks.LockSupport.parkNanos(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer.doAcquireSharedNanos(Unknown Source) at java.util.concurrent.locks.AbstractQueuedSynchronizer.tryAcquireSharedNanos(Unknown Source) at java.util.concurrent.CountDownLatch.await(Unknown Source) at com.google.net.rpc.util.RpcWaiter.waitForRpcsToFinish(RpcWaiter.java:96) at com.google.apphosting.runtime.ApiProxyImpl.doSyncCall(ApiProxyImpl.java:108) at com.google.apphosting.runtime.ApiProxyImpl.access$000(ApiProxyImpl.java:37) at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:75) at com.google.apphosting.runtime.ApiProxyImpl$1.run(ApiProxyImpl.java:71) at java.security.AccessController.doPrivileged(Native Method) at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:71) at com.google.apphosting.runtime.ApiProxyImpl.makeSyncCall(ApiProxyImpl.java:37) at com.google.apphosting.api.ApiProxy.makeSyncCall(ApiProxy.java:79) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java:24) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:220) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java:210) at com.newatlanta.appengine.datastore.CachingDatastoreService.queueWatchDogTask(CachingDatastoreService.java:388) at com.newatlanta.appengine.datastore.CachingDatastoreService.doGet(CachingDatastoreService.java:374) at javax.servlet.http.HttpServlet.service(HttpServlet.java:693) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363) at com.google.net.rpc.impl.Server$2.run(Server.java:814) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java:56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java:516) at com.google.net.rpc.impl.Server.startRpc(Server.java:769) at com.google.net.rpc.impl.Server.processRequest(Server.java:351) at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java:437) at com.google.net.rpc.impl.RpcConnection.parseMessages(RpcConnection.java:319) at
[appengine-java] Re: Master/Detail relations and redundant data handling
Consider this test case. A Person belongs to 1 or more Institutions so there's 2 ways you would want to query this. Query #1: Given a particular Person then which Institutions does he belong to? Query #2: Given a particular Institution then which Persons are members? Assume entity Person and its associated child relations will form its own entity group and, likewise, entity Institution will form its own entity group related to its children. In order to accommodate large amounts of Person and Institution data, I submit that you would need owned relations of each. Therefore, you would need entity PersonInstitutions as an owned child relation with Person for Query #1. Similarly, you would need entity InstitutionPersons as an owned child relation with Institution for Query #2. Also, each of these 2 child entities would contain both a PersonFK and a InstitutionFK with appropriate redundant fields ancillary to the query requirement of the app. Again, the embedded FK class avoids extra queries that would kill search list performance, etc. For example with Query #2, give me all persons at Baylor that have first name James would only need the entity InstitutionPersons. So, we accept the fact the design requires redundant data in the embedded FK class but at least from a source code perspective we only have FK class to manage. Is it correct that we would need both owned relations or not? Say you had Persons and Institutions from around the world. I can't imagine satisfying the above 2 queries without both owned relations. Of course, this means updates to both relations are across 2 entity groups and separate transactions. Another fact we have to accept in the design right? On Nov 3, 2:22 pm, James H james.hollier...@gmail.com wrote: Ok Bryce...I'm back. Going to test with your ideas now. In my case, I tend to avoid generic column names like id in favor of bookId and chapterId so I should not have any naming conflicts (at least rarely). Also, my FK embedded classes should not have any collections though I have a feeling they may come up as I get further into it. I'll just test with Book and owned relation Chapter as you have it here. How do we tell JDO whether a relation is owned vs unowned by the way? Because I would like to have a child object of each for the testing. Thanks! On Oct 9, 12:06 pm, bryce cottam bcot...@gmail.com wrote: FYI, this video was hugely helpful for me, and this information helps me decide how to structure my data model to run best on the app-engine, it's a Google I/O session on how the app-engine big table implementation works:http://www.youtube.com/watch?v=tx5gdoNpcZM On Fri, Oct 9, 2009 at 10:46 AM, James H james.hollier...@gmail.com wrote: Ylmz, thats how I see it too. Any significant data model will be riddled with FKs and since GAE datastore does not support Joins you have NO choice but to denormalize your data to meet the needs of your app queries. The Cottam Pattern above allows best management of source to accomplish this denormalization. I assume the simple example you are referring to either only stores the Keys in the physical table (which would be insufficient for app queries) or stores the whole record (which would be massive overkill). Does that make any sense? On Oct 8, 4:46 am, bryce cottam bcot...@gmail.com wrote: yes, I think the point that we are making is that we are trying to managed un-owned relationships :) You are describing owned relationships, which I use as well, but in many cases, I really want un-owned relationships. For a variety of reasons really, one of which is that the children I have in my collection get get rather big, and there is a cap on the number of writes that can happen on an entity group. So, in come cases it's better to model the relationships as foreign keys. The problem comes in when you try to manage your data. It's a pretty common suggestion from the app-engine team to denormalize, we're just trying to come up with a way to denormalize and minimize code duplication etc. Denormalizing will let you query better/faster etc. but can create headaches when trying to update a single field which is mirrored on several other entities. For instance, you could have an Employee that works for several departments in a company. It's the same Employee, so it should be a single record. So, in this case you'd have a Company, Division and Employee. A Company owns it's Divisions and it also owns it's Employees, yet a Division owns it's Employees as well. So, where does the collection of Employees live? On the Company, or the Division? If it's the Division, then you can't share employees with other divisions (unless you duplicate the Employee record). If the Company owns the Employee, then you have to make some way for the Division to know who's in it. You could do this by putting a
[appengine-java] Re: using maven with jpa
I don't know if this will help (maybe it's the datanucleus-core dependency with a scope of runtime), but here's my pom for jdo. This is a dependency pom; it encapsulates the dependencies for app engine datanucleus jdo. Put it in a directory by itself, create a src dir (not sure if that part is necessary) and then run mvn install and it will install the pom in your personal maven repo and then you can use it as a dependency (i.e., as if it was a fat jar full of what's listed in it). Then in your real project you can use it with dependency groupIdorg.objecteffects/groupId artifactIddependencies-appengine/artifactId version1.2.6/version typepom/type /dependency Note that the type pom is important. You can change the groupId, artifactId, version, etc. to whatever you want (in both poms). ?xml version=1.0 encoding=ISO-8859-1 ? project xmlns=http://maven.apache.org/POM/4.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation= http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd; modelVersion4.0.0/modelVersion groupIdorg.objecteffects/groupId artifactIddependencies-appengine/artifactId packagingpom/packaging namegoogle app engine jdo dependencies/name version1.2.6/version descriptiongoogle app engine jdo dependencies module/description dependencies dependency groupIdcom.google.appengine.orm/groupId artifactIddatanucleus-appengine/artifactId version${version.google-datanucleus-appengine}/version /dependency dependency groupIdorg.datanucleus/groupId artifactIddatanucleus-core/artifactId version${version.datanucleus-core}/version scoperuntime/scope /dependency dependency groupIdjavax.jdo/groupId artifactIdjdo2-api/artifactId version${version.jdo}/version /dependency dependency groupIdjavax.transaction/groupId artifactIdjta/artifactId version${version.jta}/version /dependency dependency groupIdorg.datanucleus/groupId artifactIddatanucleus-jpa/artifactId version${version.datanucleus-jpa}/version /dependency /dependencies repositories repository idgoogle-maven-repo/id urlhttp://google-maven-repository.googlecode.com/svn/repository//url /repository /repositories properties version.google-appengine1.2.6/version.google-appengine version.google-datanucleus-appengine1.0.3/version.google-datanucleus-appengine version.datanucleus-core1.1.6/version.datanucleus-core version.datanucleus-jpa1.1.5/version.datanucleus-jpa version.datanucleus-springframework1.0.0/version.datanucleus-springframework version.jdo2.3-eb/version.jdo version.jta1.1/version.jta /properties /project alexh wrote: I was wondering if anyone has a working Maven pom.xml they would be willing to share. I've looked at a number of older posts and blogs concerning this topic and have run into a slew of various issues trying to create my own. I know you can shell out to an Ant task but I'd like to use the maven-datanucleus-plugin if possible. Or, maybe that's the problem? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Master/Detail relations and redundant data handling
I don't know if this will help, but I finally figured out how to do parent queries using the parent's primary key. At the moment I don't see what advantage there is if you're storing a reference to the parent object in the child and using mappedBy in the parent, but here's what I have, in case it might be useful. Here's the child class; note its parentId field and its @Extension. It fills in this field automatically but you have to use either Key or the encoded String for the parent's primary key. Maybe this extension was necessary before they added the capability to have a direct reference to the parent (i.e., the latter is recent)? @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class Platform implements Serializable, ComparablePlatform { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = true) private String id; @Persistent private String name; @Persistent private Short ordinal; @Persistent(defaultFetchGroup = true) private Facility facility; @Element(dependent = true) @Persistent(defaultFetchGroup = true, mappedBy = platform) private SetHost hosts = new HashSetHost(0); @Element(dependent = true) @Persistent(defaultFetchGroup = true, mappedBy = platform) private SetWaitlistEntry waitlistEntries = new HashSetWaitlistEntry(0); @Persistent(defaultFetchGroup = true) @Extension(vendorName = datanucleus, key = gae.parent-pk, value = true) private String parentId; The parent class is unremarkable: @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class Facility implements Serializable, ComparableFacility { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = true) private String id; @Persistent private String name; @Persistent private Boolean waitlistEnabled; @Element(dependent = true) @Persistent(defaultFetchGroup = true, mappedBy = facility) private SetPlatform platforms = new HashSetPlatform(0); Then the Platform dao looks like public ListPlatform findByFacility(final Facility facility) { final Query query = newQuery(parentId == :parentIdParam); query.setOrdering(ordinal asc); final ListPlatform results = findByQuery(query, facility.getId()); You can probably figure out what it looks like when you use the Facility object rather than its id. James H wrote: Consider this test case. A Person belongs to 1 or more Institutions so there's 2 ways you would want to query this. Query #1: Given a particular Person then which Institutions does he belong to? Query #2: Given a particular Institution then which Persons are members? Assume entity Person and its associated child relations will form its own entity group and, likewise, entity Institution will form its own entity group related to its children. In order to accommodate large amounts of Person and Institution data, I submit that you would need owned relations of each. Therefore, you would need entity PersonInstitutions as an owned child relation with Person for Query #1. Similarly, you would need entity InstitutionPersons as an owned child relation with Institution for Query #2. Also, each of these 2 child entities would contain both a PersonFK and a InstitutionFK with appropriate redundant fields ancillary to the query requirement of the app. Again, the embedded FK class avoids extra queries that would kill search list performance, etc. For example with Query #2, give me all persons at Baylor that have first name James would only need the entity InstitutionPersons. So, we accept the fact the design requires redundant data in the embedded FK class but at least from a source code perspective we only have FK class to manage. Is it correct that we would need both owned relations or not? Say you had Persons and Institutions from around the world. I can't imagine satisfying the above 2 queries without both owned relations. Of course, this means updates to both relations are across 2 entity groups and separate transactions. Another fact we have to accept in the design right? On Nov 3, 2:22 pm, James H james.hollier...@gmail.com wrote: Ok Bryce...I'm back. Going to test with your ideas now. In my case, I tend to avoid generic column names like id in favor of bookId and chapterId so I should not have any naming conflicts (at least rarely). Also, my FK embedded classes should not have any collections though I have a feeling they may come up as I get further into it. I'll just test with Book and owned relation Chapter as you have it here. How do we tell JDO whether a relation is owned vs unowned by the way? Because I would like to have a child object of each for the testing.
[appengine-java] Re: managing root / parent objects
Great, thanks for answering that question. It's nice to know it's a possible solution; as we can see from the Bryce Cottam, James H, Diana Cruise, et. al. thread, dealing with these unowned child objects that are in various places, it's a puzzle. My latest thinking is that using clone() for this probably isn't a good idea; later on I may need a real clone, and for this my clone would probably not do a deep copy. Jason (Google) wrote: The overhead of having to fetch the inner object is negligible since you're using a direct fetch by key. You can set a @NotPersistent property of the intended type and modify your DAO methods to fetch both objects (User and FavoriteFood) and set the @NotPersistent property of the User to this fetched object. It's a few extra lines but you get the convenience of being able to access the inner object directly without polluting your datastore with cloned objects. - Jason On Sat, Oct 31, 2009 at 4:21 PM, Rusty Wright rwright.li...@gmail.com mailto:rwright.li...@gmail.com wrote: Yes, that's the point. My thinking is that (correct me if I'm wrong) if I store the object's key, when I fetch the outer containing object that has its key, I'll need to use the key to fetch the object. By cloning it, I don't need to do that, I just fetch the outer object and the inner object will get fetched along with it (assuming it's in the default fetch group). Whenever I want the outer object I'll also want its inner objects. If I store the key in the outer object, when I fetch the outer object it seems to me that I'll then need to fetch the contained object. And I'll have two fields on the outer object; using my FavoriteFood example, I'll need a field favoriteFoodKey, type Key, which is persisted, and a favoriteFood, type FavoriteFood, which is transient, and not persisted. Then my jsp would use the getter for the favoriteFood field. This is why I'm asking; it seems a bit complicated. Perhaps there's a simpler way that I could use. In my case, there isn't a lot of data so the duplication of objects isn't a big issue. John Patterson wrote: Why are you cloning instead of setting the original object? JDO will store the clone as a separate entity in the datastore. 2009/11/1 Rusty Wright rwright.li...@gmail.com mailto:rwright.li...@gmail.com mailto:rwright.li...@gmail.com mailto:rwright.li...@gmail.com I'm trying to figure out the best way to manage root objects that are used with different objects. For a semi concrete example, suppose you have a web page with a drop down list of Favorite Foods, and a User object may have a reference to a FavoriteFood, and other objects will have references to FavoriteFood objects as well. It seems to me that if individual FavoriteFood objects don't change, but the list (table) of FavoriteFood objects can grow, you could make them Cloneable and use the clone, making it a child, for example: FavoriteFood fav = favoriteFoodDao.findByStringId(stringId); user.addFavoriteFood(fav.clone()); Google's examples usually (always?) store the subordinate object's Key rather than a clone of the object. I can see problems with using clones; even though I'm sure they won't, they may change. Similarly, items may need to be deleted from the master FavoriteFood list/table. There may be other problems that I haven't thought of. Anyhow, I'm wondering if others have gone done this road or investigated it and can offer advise. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Issue with com.google.appengine.api.datastore.Text?
Thanks Rusty. I will keep this in mind.. On Nov 4, 12:13 am, Rusty Wright rwright.li...@gmail.com wrote: Beats me. It seems to be some sort of pixie dust you'll often need to apply. You don't need it for String, Long, Date, and a variety of other jdk classes, but I think you will need it for your classes. I don't understand why it's not used in the GAE web site's documentation. Tito George wrote: Thanks, It is working. Is this an issue? Or is it specific to Text On Nov 3, 11:00 am, Rusty Wright rwright.li...@gmail.com wrote: What happens if you change @Persistent to @Persistent(defaultFetchGroup = true) ? Tito George wrote: Enviornment: Local I have a Text field in one Persistent capable object, @Persistent private com.google.appengine.api.datastore.Text event_Description; I am sure that i am not setting null into this field. But while operating on queried object event_Description.getValue() is throwing NullPointerException. I am quering like this. public static MapLong, Event getEvents(AppUser appUser){ PersistenceManager pm = PMF.getInstance().getPersistenceManager(); Query query = pm.newQuery(Event.class); query.setFilter(email == pEmail); query.declareParameters(String pEmail); ListEvent result = null; MapLong, Event eventsMap = null; try { result = (ListEvent) query.execute(appUser.getEmail()); eventsMap = new HashMapLong, Event(); for(Event e: result){ //LINE TO REPLACE eventsMap.put(e.getEvent_ID(), e); } } finally { pm.close(); query.closeAll(); } return eventsMap; } Its works fine if I replace above commented line(//LINE TO REPLACE) with String str = e.getEvent_Description(); or sop(e.getEvent_Description()); or e.getEvent_Description(); Any Comments??? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: ClassCastException after changing PK from Long to String
Thank you very much! I will do that just as a backup solution for the next time I want to clear the sessions. On Nov 3, 7:05 pm, John Patterson jdpatter...@gmail.com wrote: Sessions are also stored in memcache. To clear this you can write a simple page that calls memcache.clearAll(); 2009/11/3 pgoetz pgo...@pgoetz.de Hi Jason, thank you very much for your answer. I think that you are right, but have to admit, that I cannot prove it. I have tested the application again after some time (browser has been closed in between), and everything worked fine. Is it possible, that sessions (javax.servlet.http.HttpSession) are not being killed between application deployments? I have deleted the data in my datastore via the Admin Console, just as you proposed, and no data had been left. But I remember one instance of this persistent object in the session (although I thought I would detach it from the datastore), and that could have been the one that caused this problem. I would very much appreciate the information, if the session data is being kept alive between deployments and if I can delete those as well. Thanks a lot! Greetings, Peter --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: AppEngine Java stability concerns
Hi Ross, Thank you for your response. I will monitor the downtime notify group from now on. Even though this was a planned outage, I am still quite concerned that a complete downtime of over 1h is necessary on your infrastructure... What is the strategy you suggest to your customers to handle this type of downtime? How often should we expect to be completely down (the data store being read only is a total downtime for most web apps)? Regarding my other question about short outages we have been noticing through out the day: what is the best way to report these to you such as we can help your team understand and debug short issues? Thank you. Jerome On Nov 3, 8:21 pm, Max Ross (Google) maxr+appeng...@google.com wrote: Hi Jerome, There is planned maintenance going on right now. I'd strongly encourage you to subscribe to the App Engine Downtime Notify group where you can learn about these things in advance: http://groups.google.com/group/google-appengine-downtime-notify Thanks, Max On Tue, Nov 3, 2009 at 6:18 PM, Jerome jerome.mou...@gmail.com wrote: Hello, Our app has been running on AppEngine Java for 2 months. We are now ramping up on traffic and have enabled the billing feature. We are seeing on a daily basis short (1-2 minutes) outages. Most of the time, this is on the datastore, but these short outages sometimes affect other areas as well, like for instance serving static content. Today, we are seeing a data store in anomaly. This has been going on for over an our now: Uncaught exception from servlet com.google.apphosting.api.ApiProxy$CapabilityDisabledException: The API call datastore_v3.Put() is temporarily unavailable. We are completely dead in the water... My 2 questions are: - how/where can we report short outages that are usually not reflected on the AppEngine system status? - what is the AppEngine team plan to ensure a reliable service Jerome --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Master/Detail relations and redundant data handling
Hi James, sorry for the delay, My design is currently similar to what you proposed. However, in your example, I'd probably make 2 classes: PersonFK and InstitutionFK.: public class PersonFK { private Key id; private String firstName; private String lastName; private String city; } public class InstitutionFK { private Key id; private String name; private String city; } Then in Person you would have: public class Person { private ListInstitutionFK institutions; } and in Institutions you would have: public class Institution { private ListPersonFK persons; } (I'm leaving out the annotations for brevity). each of these member fields (institutions and persons) are owned by their containing instance of Person and Institutions. Thus, the relationship is defined by who owns it (i.e we don't need the Institution's id, name, city etc. on the persons collection because we already know what Institution the PersonFK's are linked to) So, yes, anytime you want to do something like update the Person.city field, you'd want to get all PersonFK instances with your person-Id, then update each instance with the new city value. Of course, this only matters if you plan on querying Institutions based off of the city field of a Person. That generally would imply multiple transactions, however there is the Wilkerson distributed transaction model, which makes global transactions on GAE possible. So, if your writes really do need to be transactional, then you can do an all or nothing operation on multiple entity groups with this approach. here is a video from Google I/O about distributed transactions on the GAE: http://www.youtube.com/watch?v=IOtBlzsx0m8 On Tue, Nov 3, 2009 at 1:50 PM, James H james.hollier...@gmail.com wrote: Consider this test case. A Person belongs to 1 or more Institutions so there's 2 ways you would want to query this. Query #1: Given a particular Person then which Institutions does he belong to? Query #2: Given a particular Institution then which Persons are members? Assume entity Person and its associated child relations will form its own entity group and, likewise, entity Institution will form its own entity group related to its children. In order to accommodate large amounts of Person and Institution data, I submit that you would need owned relations of each. Therefore, you would need entity PersonInstitutions as an owned child relation with Person for Query #1. Similarly, you would need entity InstitutionPersons as an owned child relation with Institution for Query #2. Also, each of these 2 child entities would contain both a PersonFK and a InstitutionFK with appropriate redundant fields ancillary to the query requirement of the app. Again, the embedded FK class avoids extra queries that would kill search list performance, etc. For example with Query #2, give me all persons at Baylor that have first name James would only need the entity InstitutionPersons. So, we accept the fact the design requires redundant data in the embedded FK class but at least from a source code perspective we only have FK class to manage. Is it correct that we would need both owned relations or not? Say you had Persons and Institutions from around the world. I can't imagine satisfying the above 2 queries without both owned relations. Of course, this means updates to both relations are across 2 entity groups and separate transactions. Another fact we have to accept in the design right? On Nov 3, 2:22 pm, James H james.hollier...@gmail.com wrote: Ok Bryce...I'm back. Going to test with your ideas now. In my case, I tend to avoid generic column names like id in favor of bookId and chapterId so I should not have any naming conflicts (at least rarely). Also, my FK embedded classes should not have any collections though I have a feeling they may come up as I get further into it. I'll just test with Book and owned relation Chapter as you have it here. How do we tell JDO whether a relation is owned vs unowned by the way? Because I would like to have a child object of each for the testing. Thanks! On Oct 9, 12:06 pm, bryce cottam bcot...@gmail.com wrote: FYI, this video was hugely helpful for me, and this information helps me decide how to structure my data model to run best on the app-engine, it's a Google I/O session on how the app-engine big table implementation works:http://www.youtube.com/watch?v=tx5gdoNpcZM On Fri, Oct 9, 2009 at 10:46 AM, James H james.hollier...@gmail.com wrote: Ylmz, thats how I see it too. Any significant data model will be riddled with FKs and since GAE datastore does not support Joins you have NO choice but to denormalize your data to meet the needs of your app queries. The Cottam Pattern above allows best management of source to accomplish this denormalization. I assume the simple example you are referring to either only stores