[appengine-java] Re: Problem with exception on server startup when GAE sdk is in svn
It's a bug triggered by the fact that the .svn directories are read-only. If you make those directories writable the problem *should* go away. Please try that out and let me know. Thanks, Max -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/KFK8hW26r28J. 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.
Re: [appengine-java] Re: Number of writes per second limitation
5 put() RPCs plus one more for the commit, although you could use a batch put to turn this into 1 put() RPC plus one more for the commit. These are implementation details though. We may at some point just hold on to the entire mutation until commit time (easy if you're not asking us to generate ids for any of your entities, harder if you are since we would then need to maintain a client-side cache of ids to avoid RPCs just for id-generation). -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/qSsxcAlgC9QJ. 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] DataNucleus App Engine Plugin v2.0.0-RC1 available for testing
JPA 2, JDO 3, unowned relationships, and tons of bug fixes. https://plus.google.com/102837845875216819095/posts/9U9VFWqhPx7 -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/zwhh5eEfXx8J. 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.
Re: [appengine-java] Re: JDO and XG transactions - Performance
We debated this quite a bit internally. To paraphrase the argument that carried the day: XG transactions are awesome but they are not true global transactions. You're limited to 5 entity groups, you're more likely to see partially applied transactions in global query results, you can get a concurrency exception from a *read*, and there is a performance impact (when you've got more than 1 entity group enlisted). In short, there's some surprising/subtle stuff that we really want developers to understand before they start using this feature. If we didn't require opt-in it would be too easy for our new developers (particularly those coming from the RDBMS world where global transactions are the norm) to miss these important considerations. We want it to be super easy to use the Datastore, but creating a false sense of simplicity can do more harm than good in the long run. Max -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/mq8YLNx0kaoJ. 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: XG Transactions with JDO/JPA
Enabling HR locally is described here: http://code.google.com/appengine/docs/java/tools/devserver.html#Using_the_Datastore -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/8YL--iXPbIkJ. 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] XG Transactions with JDO/JPA
Hi everyone, Due to a mix-up, the JDO/JPA jars that are included in the 1.5.5 SDK do *not *support XG Transactions. If you want to use XG Transactions with JDO or JPA in 1.5.5 you can download an updated jar from http://code.google.com/p/datanucleus-appengine/downloads/detail?name=datanucleus-appengine-1.0.10.final.jar and follow the installation instructions on that page. Please let me know if you have any problems with it. Sorry for the trouble, Max -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To view this discussion on the web visit https://groups.google.com/d/msg/google-appengine-java/-/WXNFlj2PlvwJ. 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.
Re: [appengine-java] Re: why the development of java tools fall far behind that of python's?
I would also point out that it is possible for Java apps to migrate from Master/Slave to High Replication: http://code.google.com/appengine/docs/adminconsole/datastoreadmin.html#Copying_Entities_to_Another_Application Having to create an empty Python version of your app is no doubt clunky and not something we're happy about having to recommend, but it doesn't take much effort and it does work. Max On Thu, May 26, 2011 at 9:37 AM, Mitch Rudominer rudomi...@google.comwrote: Tapir, thanks for your feedback. I agree that there have been several cases where features have come out in Python long before Java. (There have been a few in the other direction too, but not as many.) This is something we are trying to improve upon in the future. I'm happy to tell you that one of the items in your list, 1. remove obsolete indexes, is supported in Java and has been since release 1.4.2 earlier this year. This feature is called vacuum indexes. - Mitch On May 25, 9:00 am, Tapir tapir@gmail.com wrote: such as: 1. remove obsolete indexes 2. copy Mater-Slave data to High Replication I think if these tools are already done in python, it would be easy to port them in java within one week, especially for your googlers. But why have you done these yet? You know, these tools are so essential. Many java developers feel hopeless now. -- 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. -- 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: Can remote api be used inside a GAE java app.
This is on our radar but it's not yet supported. Max -- 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: Will movement out of preview status give free access to SQL
We don't have anything to announce related to SQL pricing and quotas, but the access for Java apps will be through JDBC. Max -- 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: Backends Javadoc Reference not uploaded
I see it here in com.google.appengine.api.backends: http://code.google.com/appengine/docs/java/javadoc/ Where are you looking? Max -- 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.
Re: [appengine-java] Multiple Async get vs one Sync batch get?
Interesting results! I've run similar tests with writes (put and delete) and my results indicate that in most situations, multiple async writes will perform better than one batch sync call. I can't think of any reason this wouldn't be the case for reads as well. Are your entities all in different entity groups? Thanks, Max On Fri, Dec 17, 2010 at 4:11 PM, Ikai Lan (Google) ikai.l+gro...@google.comikai.l%2bgro...@google.com wrote: Very cool. Thanks for posting! What kind of processing are you doing after you retrieve the entities? I'm surprised it made a difference. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Fri, Dec 17, 2010 at 2:48 PM, Gal Dolber gal.dol...@gmail.com wrote: Even better :) [image: Screen shot 2010-12-17 at 7.48.44 PM.png] On Fri, Dec 17, 2010 at 7:31 PM, Gal Dolber gal.dol...@gmail.com wrote: Here are my results if anyone interested. The idea was splitting a batch into multiple async gets so I could start processing each results while the others were being fetched. With the batch get I need to wait until I get all the results to do the next operations. At the end (on my situation) batching won. * * *Multiple async gets* [image: MultipleAsyncs.png] *Batching* [image: Batch.png] On Thu, Dec 16, 2010 at 4:48 PM, Gal Dolber gal.dol...@gmail.comwrote: Yes, I am talking about datastore api. I made some isolated tests and the batch always wins (no by so much). But in my app, when I break the batch into multiple async gets, I can start processing each async get result (and doing another api calls) before... and it seems to be perform better. I'll keep doing tests and post if find anything interesting. Thanks! On Thu, Dec 16, 2010 at 2:42 PM, Ikai Lan (Google) ikai.l+gro...@google.com ikai.l%2bgro...@google.com wrote: You're talking about the datastore API? Underneath the hood, synchronous gets just make asynchronous calls and block on Future.get() anyway. Making a single synchronous batch get would translate to a single asynchronous RPC with multiple keys vs. multiple asynchronous get RPCs. I suspect the single batch call will perform better from a CPU cost/quota perspective, but I'd defer to AppStats benchmarks as the authoritative answer. -- Ikai Lan Developer Programs Engineer, Google App Engine Blogger: http://googleappengine.blogspot.com Reddit: http://www.reddit.com/r/appengine Twitter: http://twitter.com/app_engine On Wed, Dec 15, 2010 at 3:38 AM, Gal Dolber gal.dol...@gmail.comwrote: Should I expect the similar performance? or the batch will always be better? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Guit: Elegant, beautiful, modular and *production ready* gwt applications. http://code.google.com/p/guit/ -- Guit: Elegant, beautiful, modular and *production ready* gwt applications. http://code.google.com/p/guit/ -- Guit: Elegant, beautiful, modular and *production ready* gwt applications. http://code.google.com/p/guit/ -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- You received this message because you are subscribed to the Google Groups
Re: [appengine-java] Re: datanucleus-appengine
There's a big difference between something that is deprecated and something that isn't getting any new features. JDO/JPA is most certainly not deprecated. We are making sure it is keeping pace with our new SDK releases, and we hope to be able to start enhancing it as soon as we can. There is still a lot of good and important work to be done on this library, but the App Engine team always prioritizes the reliability and availability of our product over feature-related work, and as of late, those of us working on the Datastore have been almost entirely focused on the former (did you see the mention of the High Replication Datastore in our latest blog posthttp://googleappengine.blogspot.com/2010/12/happy-holidays-from-app-engine-team-140.html ?) Finally, I'll point out that our DataNucleus plugin is completely open source. If you or anyone else in the community would like to submit a patch with thorough test cases we will be happy to work with you to get it submitted. Thanks, Max On Fri, Dec 3, 2010 at 1:32 PM, George Moschovitis george.moschovi...@gmail.com wrote: You're eager optimizing your support problem, when really the problem you should be solving is what do I need to build? How do I get there? I know what I want to build. My problem is that I (obviously) need a Datastore API. In the Google App Engine documentation the endorsed API was (until now) JDO (and maybe JPA). From your earlier post I learned that JDO/JPA support is ..kind of deprecated. I don't plan to create a new API myself. I would prefer to use a Google-endorsed API, but today there is no such thing. I find this annoying. I may be wrong, but this is my perspective, we can't all agree on everything. Still, you should keep developer concerns in mind when laying out the road map for future releases. regards, -g. PS: and yes, I 'll probably use Objectify after all... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] no async queries on AsyncDatastoreService for 1.4.0?
Hi Luke, First the awesome news: As of 1.4.0, many queries are implicitly asynchronous. When you call PreparedQuery.asIterable() or PreparedQuery.asIterator(), we initiate the query in the background and then immediately return. This lets you do work while the first batch of results is being fetched. And, when the first batch has been consumed we immediately request the next batch. If you're performing a significant amount of work with each Entity as you iterate you will probably see a latency win as a result of this. Now the less awesome news: We didn't get around to making the List returned by PreparedQuery.asList() work this same magic, but you can expect this in a future release. Some deeper thoughts: The underlying RPCs between your app and the datastore fetch results in batches. We fetch an initial batch of results, and once that batch has been consumed we fetch the next batch. But, there's nothing in the API that maps to these batches - it's either a List containing the entire result set or an Iterable/Iterator that returns Entities one at a time. An API that provides async access to the individual results returned by an Iterable/Iterator (IteratorFutureEntity) doesn't really make sense since you don't know which call to hasNext() is going to require a new batch to be fetched, and without that knowledge, the knowledge of what is going to trigger something expensive, you can't really make appropriate use of an asynchronous API. Going forward, we're definitely interested in exposing these batches directly, and an explicitly async API for these batches makes a lot of sense since fetching these batches would map directly to something expensive on the server side. Hope this helps, Max On Fri, Nov 26, 2010 at 4:41 PM, Luke lvale...@gmail.com wrote: i was taking a look at the 1.4.0 javadoc for AsyncDatastoreService. i see the get, put and delete operations return a Future, but the prepare methods return a naked PreparedQuery object, and it doesn't look like PreparedQuery has any async get methods. does the AsyncDatastoreService not support asynchronous queries, or is there something i'm missing? glad to see at lets the get and put methods are async, hoping to get async queries too (as well as async interfaces to more services). -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] SDK 1.3.8 released!
Guillaume, Which FetchOptions class are you looking at? The last update I see to either of them was back in April and they were backwards compatible changes. Thanks, Max On Fri, Oct 15, 2010 at 5:51 AM, Guillaume Laforge glafo...@gmail.comwrote: Excellent, thank you! The instances view is really nice and interesting! I just wanted to also mention that while upgrading one of my apps, one controller wasn't compiling against the new SDK, as there had been a little rename refactoring of a method: FetchOptions.Builder#withDefault is now: FetchOptions.Builder#withDefaults Notice the final 's'! Perhaps you could publish a list of API differences between releases? I know some OSS projects publish such documents for helping people upgrade to newer versions, or for showing users what the new APIs are. Anyhow, well done for this release! Guillaume On Fri, Oct 15, 2010 at 05:44, Takashi Matsuo tmat...@google.com wrote: Hello App Engine Developers! We're very happy to announce that SDK 1.3.8 is released today. There are many new cool features, so please download the new SDK and enjoy it! You can download the new SDK from: http://code.google.com/appengine/downloads.html Our blog post includes some screenshots of new features in admin console: http://googleappengine.blogspot.com/2010/10/new-app-engine-sdk-138-includes-new.html Here are release notes: Java --- Version 1.3.8 = - You can run task queue tasks immediately from the admin console. - Added an OutputSettings class to the Images API to specify the JPEG encoding quality when running in production. - Support for login of multiple Google accounts within an app, and longer login sessions. For more information see: http://www.google.com/support/accounts/bin/answer.py?answer=181599 - In queue.xml, the maximum allowed bucket size is now 100. - Removed limits on zigzag merge-join queries. Therefore the error The built-in indices are not efficient enough for this query and your data. Please add a composite index for this query. will no longer be thrown in most cases, enabling more types of queries without indexes. - The whitelist has been updated to include java.net.InetAddress and some interfaces and abstract classes in javax.xml.soap, including javax.xml.soap.SOAPMessage. - Fixed an issue reserving App Ids by owners of emails containing periods, multiple cases, and googlemail.com address. http://code.google.com/p/googleappengine/issues/detail?id=1196 - Fixed an issue where TaskOptions had no public getters, making testing impossible. http://code.google.com/p/googleappengine/issues/detail?id=3243 - Fixed an issue on the development server where PNGs were being returned as JPEGs. http://code.google.com/p/googleappengine/issues/detail?id=3661 Python - Version 1.3.8 == - Builtin app.yaml handlers are available for common application functions, such as appstats. http://code.google.com/appengine/docs/python/config/appconfig.html#Builtin_Handlers - The Admin Console now provides an experimental tool to delete all entities in the datastore or all entities of a given type. This is available only if enabled using the datastore_admin builtin. Deleting entities will count against application quota. http://code.google.com/appengine/docs/python/datastore/creatinggettinganddeletingdata.html#Deleting_Entities_in_Bulk - You can run task queue tasks immediately from the Admin Console. - You can now specify the quality of JPEG images via the Image API's execute_transforms function. Available in production only. - Support for login of multiple Google accounts within an app, and longer login sessions. For more information see: http://www.google.com/support/accounts/bin/answer.py?answer=181599 - In queue.yaml, the maximum allowed bucket size is now 100. - Precompilation is now enabled by default. To disable, use the --no_precompilation flag when updating your app. - BlobInfo now has an open() method that returns a BlobReader. - BlobReader now accepts a BlobInfo. - Removed limits on zigzag merge-join queries. Therefore the error The built-in indices are not efficient enough for this query and your data. Please add a composite index for this query. will no longer be thrown in most cases, enabling more types of queries without indexes. - Fixed an issue with task queue tasks not running on the dev_appserver when using Python 2.6. - Fixed an issue on the dev_appserver where auto task running wasn't working for BulkAdd. - Fixed an issue reserving App Ids by owners of similarly-named mails accounts containing periods, multiple cases, and googlemail.com address. http://code.google.com/p/googleappengine/issues/detail?id=1196 - Fixed an issue on the development server where PNGs were being
Re: [appengine-java] Any changes to access levels in com.google.appengine.api.datastore recently?
We refactored the internals of the DatastoreService implementation pretty heavily in the release we just pushed out but there shouldn't have been any backwards incompatible changes to the public API. I'm not familiar with appengine-clj. Does it use reflection to access non-public classes/methods/fields? If so that's not safe, since we only guarantee backwards compatibility for the public API. If not then I'll need more info. Thanks, Max On Thu, Oct 14, 2010 at 12:14 PM, Darren Clarke dar...@redaranj.com wrote: Has anything changed with class access levels (public vs. private) in the production datastore code in the last day or so? I've had a Clojure app running for several weeks and starting last night, whenever I try to access the datastore, I get the error below. It could be a bug in the library I'm using (appengine-clj) or even in Clojure's dispatch code, but I just want to understand if anything has changed server-side that might have triggered it. The application still works on the dev appserver v1.3.7. java.lang.IllegalArgumentException: Can't call public method of non-public class: public com.google.appengine.api.datastore.Transaction com.google.appengine.api.datastore.BaseDatastoreService.getCurrentTransaction(com.google.appengine.api.datastore.Transaction) at clojure.lang.Reflector.invokeMatchingMethod(Reflector.java:85) at clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:28) at appengine.datastore.service$current_transaction.invoke(service.clj:72) at appengine.datastore.service$put_entity.invoke(service.clj:131) at appengine.datastore.service$fn__176.invoke(service.clj:149) at appengine.datastore.service$fn__136$G__116__141.invoke(service.clj:10) at com.redaranj.ledes.service.servlet$fn__1902$fn__1903.invoke(servlet.clj:17) at compojure.core$routes$fn__1706$fn__1707.invoke(core.clj:72) at clojure.core$some.invokeStatic(core.clj:2297) at compojure.core$routes$fn__1706.invoke(core.clj:71) at ring.middleware.params$wrap_params$fn__1468.invoke(params.clj:77) at ring.middleware.cookies$wrap_cookies$fn__1559.invoke(cookies.clj:123) at ring.util.servlet$make_service_method$fn__1881.invoke(servlet.clj:117) at com.redaranj.ledes.service.servlet$_service.invoke(servlet.clj:19) at com.redaranj.ledes.service.servlet.service(Unknown Source) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166) at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:97) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418) at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923) at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:261) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8483) at com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:8481) at com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24) at com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:418) at com.google.net.rpc.impl.Server$RpcTask.runInContext(Server.java:572)
Re: [appengine-java] Re: CloudCover: Cannot schedule instance of TestClass because of not an available class
Thanks for trying CloudCover! Unfortunately CloudCover's support for datastore tests rely on an App Engine feature called Namespaces that is not yet available to all apps. This feature should be widely available soon, at which point your error message will go away. Sorry for the trouble, Max On Sat, Jul 10, 2010 at 12:26 PM, luijar luis.j.aten...@gmail.com wrote: I have not been able to successfully run any tests that involve datastore access: I am seeing the following: Application (nepal-dev), attempting to use namespace (1002_877806974), is not permitted to use datastore namespaces. java.lang.IllegalArgumentException: Application (nepal-dev), attempting to use namespace (1002_877806974), is not permitted to use datastore namespaces. at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java: 34) at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(DatastoreApiHelper.java: 67) at com.google.appengine.api.datastore.DatastoreServiceImpl $2.run(DatastoreServiceImpl.java:188) at com.google.appengine.api.datastore.TransactionRunner.runInTransaction(TransactionRunner.java: 30) at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java: 176) at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java: 156) at com.google.appengine.api.datastore.DatastoreServiceImpl.put(DatastoreServiceImpl.java: 148) at com.citrix.ws.nepal.gaetest.GAEUserTest.testCreateAndReadUser(GAEUserTest.java: 37) Any thoughts??? On Jul 1, 1:13 pm, luijar luis.j.aten...@gmail.com wrote: Not sure what the problem is, all my queries are failing with this message: Illegal argument javax.jdo.JDOFatalUserException: Illegal argument at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc leusJDOHelper.java: 344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252) at Environment: SDK 1.3.4 JUnit = 4 Is there a code sample we can use as reference?, with all of the required JAR files?. I haven't been able to run a single test that requires accessing datastore. On Jun 30, 5:58 pm, luijar luis.j.aten...@gmail.com wrote: I am seeing this however, Executing a simple query: Illegal argument javax.jdo.JDOFatalUserException: Illegal argument at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(Nuc leusJDOHelper.java: 344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:252) at This query works when the actual application is running, and it works in the Local testing Helper, but not with the CloudCoverLocalServiceTestHelper. Is there a specific version of App Engine I should be using? I am using 1.3.2. On Jun 12, 11:57 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: This most likely means that your tests aren't available as part of your application. Are you certain you uploaded them? On Fri, Jun 11, 2010 at 11:31 PM, Art art...@gmail.com wrote: Dear group, I would like to know how to make CloudCover ( http://code.google.com/p/ cloudcover/) work. At cloudcover.html, even I clicked on the Start New Run button, the (default) test won't be executed. The cloudcover.html showed like: Run 1001: NOT_STARTED, Completed 0/0 (0%) Passed: 0 Too Slow: 0 Failed: 0 In Progress: 0 Not Started: 0 com.google.appengine.testing.cloudcover.harness.junit3.JUnit3TestHarness (0) I found the following logs in the GAE/J logs: W 06-11 10:45PM 49.387 com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun getTestIds: 1001: Cannot schedule instance of class com.appspot.waversbeach.server.MemcacheTest for execution because its String represenation, testInsert1(com.appspot.waversbeach.server.MemcacheTest), is not an available class. W 06-11 10:45PM 49.395 com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun getTestIds: 1001: Cannot schedule instance of class com.appspot.waversbeach.server.MemcacheTest for execution because its String represenation, testInsert2(com.appspot.waversbeach.server.MemcacheTest), is not an available class. MemcacheTest class is a really simple test class just for the trial purpose with CloudCover: public class MemcacheTest extends TestCase { public MemcacheTest( String name) { super( name); } protected static Cache cache = null; @Override protected void setUp() throws Exception { if ( cache == null) { CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory(); cache = cacheFactory.createCache( Collections.emptyMap
Re: [appengine-java] CloudCover: Cannot schedule instance of TestClass because of not an available class
This most likely means that your tests aren't available as part of your application. Are you certain you uploaded them? On Fri, Jun 11, 2010 at 11:31 PM, Art art...@gmail.com wrote: Dear group, I would like to know how to make CloudCover (http://code.google.com/p/ cloudcover/) work. At cloudcover.html, even I clicked on the Start New Run button, the (default) test won't be executed. The cloudcover.html showed like: Run 1001: NOT_STARTED, Completed 0/0 (0%) Passed: 0 Too Slow: 0 Failed: 0 In Progress: 0 Not Started: 0 com.google.appengine.testing.cloudcover.harness.junit3.JUnit3TestHarness (0) I found the following logs in the GAE/J logs: W 06-11 10:45PM 49.387 com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun getTestIds: 1001: Cannot schedule instance of class com.appspot.waversbeach.server.MemcacheTest for execution because its String represenation, testInsert1(com.appspot.waversbeach.server.MemcacheTest), is not an available class. W 06-11 10:45PM 49.395 com.google.appengine.testing.cloudcover.harness.junitx.JUnitTestRun getTestIds: 1001: Cannot schedule instance of class com.appspot.waversbeach.server.MemcacheTest for execution because its String represenation, testInsert2(com.appspot.waversbeach.server.MemcacheTest), is not an available class. MemcacheTest class is a really simple test class just for the trial purpose with CloudCover: public class MemcacheTest extends TestCase { public MemcacheTest( String name) { super( name); } protected static Cache cache = null; @Override protected void setUp() throws Exception { if ( cache == null) { CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory(); cache = cacheFactory.createCache( Collections.emptyMap()); } } @Override protected void tearDown() throws Exception { cache.clear(); } private void doTest() { assertFalse( cache.containsKey( yar)); cache.put( yar, foo); assertTrue( cache.containsKey( yar)); } public void testInsert1() { doTest(); } public void testInsert2() { doTest(); } } My JUnit3Config class is like: public class CloudCoverRunnerConfig extends JUnit3Config { @Override public TestRun newTestRun( String arg0) { TestSuite suite = new TestSuite(); suite.addTest( new MemcacheTest( testInsert1)); suite.addTest( new MemcacheTest( testInsert2)); return new JUnit3TestRun( suite); } } I'm thinking of giving the CloudCover a shot for Wave robot testing if it's possible, since I have read in one of Wave docs that there is no existing mechanism currently to test Wave robot on local machine. Thank 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] The API call datastore_v3.Put() is temporarily unavailable.
GAE is currently read-only for scheduled maintenance. I recommend subscribing to the google-appengine-downtime-notify group if you'd like to receive notifications of these events: http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/5302cb6b950ce215 http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/4857b46e4e6ff0f9 Thanks, Max On Wed, May 5, 2010 at 1:41 PM, hector hrov...@gmail.com wrote: Getting this error on Java App Engine. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Unable to update app: Error posting to URL: Error 500
GAE is currently read-only for scheduled maintenance. I recommend subscribing to the google-appengine-downtime-notify group if you'd like to receive notifications of these events: http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/5302cb6b950ce215 http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/4857b46e4e6ff0f9 Thanks, Max On Wed, May 5, 2010 at 1:45 PM, Rahul rahul.jun...@gmail.com wrote: Suddenly i have started getting the following exception exception when trying to deploy the application to appengine from eclipse. I was able to do this till 10 min before. What is the possible cause for this or there is something wrong on the server end ? com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=thoughtclickshelpversion=dev-restfb; 500 Internal Server Error Server Error (500) A server error has occurred. at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 62) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java: 271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java: 145) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java: 38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=thoughtclickshelpversion=dev-restfb; 500 Internal Server Error Server Error (500) A server error has occurred. at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java: 149) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java: 82) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java: 559) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java: 376) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java: 111) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 56) ... 4 more Thanks, Rahul -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: The API call datastore_v3.Put() is temporarily unavailable.
Hi Jerome, What error were you getting instead of ApiProxy.CapabilityDisabledException? Do you have a stack trace I can look at? Thanks, Max On Wed, May 5, 2010 at 1:57 PM, Jerome jerome.mou...@gmail.com wrote: Well... based on the announcement, we were supposed to receive a com.google.apphosting.api.ApiProxy.CapabilityDisabledException exception. For at least the first 10 minutes of the down time, it was not the case. We are sorting things out, but it looks like we lost a lot of data, as our system supposed to take over during the maintenance was based on getting the documented exception... Jerome On May 5, 3:47 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: GAE is currently read-only for scheduled maintenance. I recommend subscribing to the google-appengine-downtime-notify group if you'd like to receive notifications of these events: http://groups.google.com/group/google-appengine-downtime-notify/brows... http://groups.google.com/group/google-appengine-downtime-notify/brows.. . Thanks, Max On Wed, May 5, 2010 at 1:41 PM, hector hrov...@gmail.com wrote: Getting this error on Java App Engine. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Error uploading project to App Engine
GAE is currently read-only for scheduled maintenance. I recommend subscribing to the google-appengine-downtime-notify group if you'd like to receive notifications of these events: http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/4857b46e4e6ff0f9 http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/4857b46e4e6ff0f9 Thanks, Max On Wed, Apr 28, 2010 at 1:42 PM, Rahul Ravikumar tikura...@gmail.comwrote: When i try to update my project using the Eclipse plugin - I see the following error message in my eclipse log. I am unable to update my application on GAE. eclipse.buildId=I20090611-1540 java.version=1.6.0_20 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product Error Wed Apr 28 13:35:27 PDT 2010 Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=myappidversion=3500 Internal Server Error Server Error (500) A server error has occurred. See the deployment console for more details com.google.appengine.tools.admin.AdminException: Unable to update app: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=myappidversion=3; 500 Internal Server Error Server Error (500) A server error has occurred. at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 62) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java: 271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java: 145) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java: 38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Caused by: java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=myappidversion=3; 500 Internal Server Error Server Error (500) A server error has occurred. at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java: 149) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java: 82) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java: 559) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java: 376) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java: 111) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 56) ... 4 more The deployment log is given below: Unable to update: java.io.IOException: Error posting to URL: https://appengine.google.com/api/appversion/create?app_id=myappidversion=3; 500 Internal Server Error Server Error (500) A server error has occurred. at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java: 149) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java: 82) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java: 559) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java: 376) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java: 111) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 56) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java: 271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java: 145) at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java: 38) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55) Any ideas as to why this could be happening ? Thanks, Rahul -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at
Re: [appengine-java] Re: ApiProxyLocalImpl class not public
What aspect of the local datastore are you trying to configure that isn't covered by LocalDatastoreServiceTestConfig()? I don't think you should have to configure the ApiProxyLocal or the LocalServerEnvironment directly. On Sun, Apr 25, 2010 at 3:40 PM, mvsoares mavsoa...@gmail.com wrote: Indeed, ApiProxyLocalImpl is not public anymore in newer versions of google app engine. Find below one solution to the problem: import java.io.File; import java.util.Properties; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import junit.framework.TestCase; import com.google.appengine.api.datastore.dev.LocalDatastoreService; import com.google.appengine.tools.development.ApiProxyLocal; import com.google.appengine.tools.development.ApiProxyLocalFactory; import com.google.appengine.tools.development.LocalServerEnvironment; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig; import com.google.apphosting.api.ApiProxy; public class BaseTest extends TestCase { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalTaskQueueTestConfig()); protected PersistenceManagerFactory pmf; protected PersistenceManager pm; @Override public void tearDown() { helper.tearDown(); } @Override public void setUp() throws Exception { super.setUp(); helper.setUp(); Properties newProperties = new Properties(); newProperties.put(javax.jdo.PersistenceManagerFactoryClass, org.datanucleus.store.appengine.jdo. + DatastoreJDOPersistenceManagerFactory); newProperties.put(javax.jdo.option.ConnectionURL, appengine); newProperties.put(javax.jdo.option.NontransactionalRead, true); newProperties.put(javax.jdo.option.NontransactionalWrite, true); newProperties.put(javax.jdo.option.RetainValues, true); newProperties.put(datanucleus.appengine.autoCreateDatastoreTxns, true); newProperties.put(datanucleus.appengine.autoCreateDatastoreTxns, true); pmf = JDOHelper.getPersistenceManagerFactory(newProperties); pm = pmf.getPersistenceManager(); ApiProxyLocalFactory factory = new ApiProxyLocalFactory(); ApiProxyLocal proxy = factory.create(new LocalServerEnvironment() { public void waitForServerToStart() throws InterruptedException { } public int getPort() { return 0; } public File getAppDir() { return new File(.); } public String getAddress() { return null; } }); proxy.setProperty( // LocalDatastoreService.BACKING_STORE_PROPERTY, LocalDatastoreService.NO_STORAGE_PROPERTY, Boolean.TRUE.toString()); ApiProxy.setDelegate(proxy); } } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: ApiProxyLocalImpl class not public
Your JDO config is not related to LocalServiceTestHelper or LocalDatastoreServiceTestConfig. If you create your PersistenceManager in the typical way after you create a LocalServiceTestHelper with a LocalDatastoreServiceTestConfig and then call helper.setUp() you should be all set. Max 2010/4/26 Marcos Vinícius Soares mavsoa...@gmail.com I just wanted an instance of PersistenceManager to use in unit tests and I was able to setup it up. I'm not sure how to get it through LocalDatastoreServiceTestConfig. Anyway, it is working now as per the code I sent earlier. Thanks On Mon, Apr 26, 2010 at 1:33 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: What aspect of the local datastore are you trying to configure that isn't covered by LocalDatastoreServiceTestConfig()? I don't think you should have to configure the ApiProxyLocal or the LocalServerEnvironment directly. On Sun, Apr 25, 2010 at 3:40 PM, mvsoares mavsoa...@gmail.com wrote: Indeed, ApiProxyLocalImpl is not public anymore in newer versions of google app engine. Find below one solution to the problem: import java.io.File; import java.util.Properties; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import junit.framework.TestCase; import com.google.appengine.api.datastore.dev.LocalDatastoreService; import com.google.appengine.tools.development.ApiProxyLocal; import com.google.appengine.tools.development.ApiProxyLocalFactory; import com.google.appengine.tools.development.LocalServerEnvironment; import com.google.appengine.tools.development.testing.LocalServiceTestHelper; import com.google.appengine.tools.development.testing.LocalTaskQueueTestConfig; import com.google.apphosting.api.ApiProxy; public class BaseTest extends TestCase { private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalTaskQueueTestConfig()); protected PersistenceManagerFactory pmf; protected PersistenceManager pm; @Override public void tearDown() { helper.tearDown(); } @Override public void setUp() throws Exception { super.setUp(); helper.setUp(); Properties newProperties = new Properties(); newProperties.put(javax.jdo.PersistenceManagerFactoryClass, org.datanucleus.store.appengine.jdo. + DatastoreJDOPersistenceManagerFactory); newProperties.put(javax.jdo.option.ConnectionURL, appengine); newProperties.put(javax.jdo.option.NontransactionalRead, true); newProperties.put(javax.jdo.option.NontransactionalWrite, true); newProperties.put(javax.jdo.option.RetainValues, true); newProperties.put(datanucleus.appengine.autoCreateDatastoreTxns, true); newProperties.put(datanucleus.appengine.autoCreateDatastoreTxns, true); pmf = JDOHelper.getPersistenceManagerFactory(newProperties); pm = pmf.getPersistenceManager(); ApiProxyLocalFactory factory = new ApiProxyLocalFactory(); ApiProxyLocal proxy = factory.create(new LocalServerEnvironment() { public void waitForServerToStart() throws InterruptedException { } public int getPort() { return 0; } public File getAppDir() { return new File(.); } public String getAddress() { return null; } }); proxy.setProperty( // LocalDatastoreService.BACKING_STORE_PROPERTY, LocalDatastoreService.NO_STORAGE_PROPERTY, Boolean.TRUE.toString()); ApiProxy.setDelegate(proxy); } } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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
Re: [appengine-java] Re: TaskOptions.countdownMillis not used
The dev server used to not execute tasks automatically at all but now the functionality emulates prod pretty closely. On Fri, Apr 23, 2010 at 6:02 AM, James jamesk...@gmail.com wrote: Are you seeing this on the dev server or in production? I vaguely recall reading somewhere that the dev server always executes immediately(??). James On Apr 22, 4:21 pm, Fabrizio fht...@gmail.com wrote: Hello, I need to add a task in the TaskQueue. But I need a small delay before exectution (2 seconds). I use countdownMillis(long) to delay the execution. But execution starts immediatelly. I don't understand if my code is wrong or if there is a problem with countdownMillis. My code is: Queue queue = QueueFactory.getQueue(queueName); TaskOptions taskOpts = TaskOptions.Builder.url(url); taskOpts.countdownMillis(delay); taskOpts.method(Method.GET); queue.add(taskOpts); Thank you for help fabrizio -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: TaskOptions.countdownMillis not used
The difference between 2 seconds and immediate isn't much. How are you measuring? Do you have logs that show the time at which the task was enqueued and the time at which it executes? Thanks, Max On Fri, Apr 23, 2010 at 12:31 PM, Fabrizio fht...@gmail.com wrote: Production. On Apr 23, 3:02 pm, James jamesk...@gmail.com wrote: Are you seeing this on the dev server or in production? I vaguely recall reading somewhere that the dev server always executes immediately(??). James -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] QueueFactory and NoClassDefFoundError
Hi Felipe, Can you print out the value of System.getProperty(java.class.path) while the app is running and see if that jar is listed? On Fri, Apr 23, 2010 at 1:56 PM, Felipe Quintella Correia felipequintell...@gmail.com wrote: Hello again. Well, unless I'm overseeing something, I'm pretty sure that the appengine-api-labs.jar is on my runtime classpath... I'm joining 2 printscreens to confirm (if it is allowed), but I think that's it... I have App Engine SDK 1.3.2 on my classpath, and the App Engine SDK has appengine-api-labs-1.3.2.jar in it. Sorry for the newbie question, but I am stuck on it. Thank you again, Felipe Quintella PS: if joined files are not allowed, check the screens on this 2 links: http://dl.dropbox.com/u/5958704/Screen%20shot%202010-04-23%20at%2017.50.11.png http://dl.dropbox.com/u/5958704/Screen%20shot%202010-04-23%20at%2017.50.28.png 2010/4/22 Felipe Quintella Correia felipequintell...@gmail.com I'll be sure it's on the runtime classpath as soon as I am home. Thank you Felipe Quintella 2010/4/22 Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com Make sure appengine-api-labs.jar is on your runtime classpath. Max On Wed, Apr 21, 2010 at 9:00 PM, Felipe Quintella felipequintell...@gmail.com wrote: Hello there. I'm new to Google AppEngine, but I'm already searched and can't find the answer to my problem. I am trying to add a task to the default taskqueue, but i keep getting a NoClassDefFoundError with the QueueFactory class... I can't find what the problem is. I have App Engine SDK 1.3.2 added as a library, and have imported the QueueFactory successfully... Maybe you can enlighten me. Looking forward to your answer, Thank you. Felipe Quintella. Error: HTTP ERROR 500 Problem accessing /canalparser. Reason: com/google/appengine/api/labs/taskqueue/QueueFactory Caused by: java.lang.NoClassDefFoundError: com/google/appengine/api/labs/ taskqueue/QueueFactory at braziltvguide.ParseCanaisServlet.doGet(ParseCanaisServlet.java: 108) Part of the code with the problem: import com.google.appengine.api.labs.taskqueue.Queue; import com.google.appengine.api.labs.taskqueue.QueueFactory; import static com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.*; if (req.getParameter(task) == null) { Queue queue = QueueFactory.getDefaultQueue(); queue.add(url(/canalparser?tipo=getProgramastask=1)); } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] QueueFactory and NoClassDefFoundError
Make sure appengine-api-labs.jar is on your runtime classpath. Max On Wed, Apr 21, 2010 at 9:00 PM, Felipe Quintella felipequintell...@gmail.com wrote: Hello there. I'm new to Google AppEngine, but I'm already searched and can't find the answer to my problem. I am trying to add a task to the default taskqueue, but i keep getting a NoClassDefFoundError with the QueueFactory class... I can't find what the problem is. I have App Engine SDK 1.3.2 added as a library, and have imported the QueueFactory successfully... Maybe you can enlighten me. Looking forward to your answer, Thank you. Felipe Quintella. Error: HTTP ERROR 500 Problem accessing /canalparser. Reason: com/google/appengine/api/labs/taskqueue/QueueFactory Caused by: java.lang.NoClassDefFoundError: com/google/appengine/api/labs/ taskqueue/QueueFactory at braziltvguide.ParseCanaisServlet.doGet(ParseCanaisServlet.java: 108) Part of the code with the problem: import com.google.appengine.api.labs.taskqueue.Queue; import com.google.appengine.api.labs.taskqueue.QueueFactory; import static com.google.appengine.api.labs.taskqueue.TaskOptions.Builder.*; if (req.getParameter(task) == null) { Queue queue = QueueFactory.getDefaultQueue(); queue.add(url(/canalparser?tipo=getProgramastask=1)); } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] TaskOptions.countdownMillis not used
What is the value of the delay variable? On Thu, Apr 22, 2010 at 1:21 PM, Fabrizio fht...@gmail.com wrote: Hello, I need to add a task in the TaskQueue. But I need a small delay before exectution (2 seconds). I use countdownMillis(long) to delay the execution. But execution starts immediatelly. I don't understand if my code is wrong or if there is a problem with countdownMillis. My code is: Queue queue = QueueFactory.getQueue(queueName); TaskOptions taskOpts = TaskOptions.Builder.url(url); taskOpts.countdownMillis(delay); taskOpts.method(Method.GET); queue.add(taskOpts); Thank you for help fabrizio -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Google: Please, stop using the Builder pattern in the Low-Level API!
Hi Jeff, Note that DatastoreServiceConfig exposes a withDefaults() method. FetchOptions has one too but it's package protected. We didn't expose it because FetchOptions isn't required for many low level datastore calls and we didn't see why users would want to create one if they didn't plan to adjust the offset, the limit, the prefetch size, etc. We didn't consider your use case though, and it makes perfect sense. Unless there's some other aspect of the Builder pattern that is getting in your way that you have explained, I think we could easily address your concern if we exposed FetchOptions.withDefaults(). Is that right? Thanks, Max On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org wrote: This is a genuine, heartfelt plea: The Builder pattern (DatastoreServiceConfig, FetchOptions) makes code extra annoying when layering an API on top of the low-level API. Let's say you are writing some code by hand that creates a FetchOptions with a limit and an offset: FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20); Pretty straightforward when typing it out by hand, but the lack of orthogonality between withLimit() and limit() is a PITA when you're trying to automate the creation of a builder. The problem is, you can't start with a blank FetchOptions. The result is we end up writing lots of code like this: if (limit != null) { if (opts == null) opts = FetchOptions.Builder.withLimit(limit); else opts = opts.limit(limit); } This wouldn't be necessary if FetchOptions.Builder had a create() method that would produce a blank FetchOptions. Or if FetchOptions had a public constructor. Or if FetchOptions was an interface or even a nonfinal class. I notice that DatastoreServiceConfig is following in the path of FetchOptions. My initial reaction was Noo! :-) Thanks for listening, Jeff -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] com.google.appengine.api.datastore.DatastoreServiceConfig; not resolved by Eclipse with GAE plugin v1.3.2
Hi Didier, I can't say what's going on with your plugin but this is almost certainly a classpath issue. DatastoreServiceConfig was introduced in 1.3.2 so make sure you have the appengine-api.jar that shipped with SDK 1.3.2 in your classpath. Max On Thu, Apr 1, 2010 at 4:01 AM, Didier Durand durand.did...@gmail.comwrote: Hello, I need to use com.google.appengine.api.datastore.DatastoreConfig - works fine under Eclipse The Javadoc at http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/DatastoreConfig.html recommends to switch to com.google.appengine.api.datastore.DatastoreServiceConfig; When I do this change under Eclipse: I get an import com.google.appengine.api.datastore.DatastoreServiceConfig cannot be resolved a) Is there something missing in my plugin v1.3.2? b) Can some of you do the same test and let me know if they get the same error ? regards didier -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Google: Please, stop using the Builder pattern in the Low-Level API!
The 2 options you listed are indeed better, but they don't work if your goal is to prevent access to an uninitialized FetchOptions object. That was our original intent, so that's how we ended up steering you through the Builder at the start. At one point before we launched we had a more standard Builder that you had to call build() on at the end. I liked it because it meant that all the FetchOptions members could be final, but there was some debate within the team and we ultimately decided that in this case conciseness trumps immutability, so we dropped the explicit build() call and moved the setters to FetchOptions itself. We also considered putting the with constructors directly on FetchOptions and getting rid of the Builder entirely, but we decided that a static method named FetchOptions.withLimit(int limit) and an instance method named FetchOptions.limit(limit) wouldn't give enough of a hint about the intended usage. So here we are. API design is hard. Max On Thu, Apr 1, 2010 at 12:14 PM, Jeff Schnitzer j...@infohazard.org wrote: Oh, I wasn't suggesting a constructor that takes all the arguments, I'm just wondering why this: FetchOptions opts = FetchOptions.Builder.withLimit(10).offset(200); ...is better than this... FetchOptions opts = new FetchOptions().limit(10).offset(200); ...or even... FetchOptions opts = FetchOptions.create().limit(10).offset(200); Adding the Builder with duplicate-but-differently-named methods seems awkward. Jeff On Thu, Apr 1, 2010 at 11:43 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Ok, we'll expose that method. With a public constructor it's very easy to mix up your args, especially when you have args of the same type. For example, someone is pretty much guaranteed to mix up the offset, limit, and prefetch args. A Builder prevents this. Josh Bloch has a nice chapter on this in the 2nd edition of Effective Java. Max On Thu, Apr 1, 2010 at 11:10 AM, Jeff Schnitzer j...@infohazard.org wrote: Yes, that would solve the problem. Although I have to wonder, how is this any better than having a public constructor? Jeff On Thu, Apr 1, 2010 at 10:08 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Hi Jeff, Note that DatastoreServiceConfig exposes a withDefaults() method. FetchOptions has one too but it's package protected. We didn't expose it because FetchOptions isn't required for many low level datastore calls and we didn't see why users would want to create one if they didn't plan to adjust the offset, the limit, the prefetch size, etc. We didn't consider your use case though, and it makes perfect sense. Unless there's some other aspect of the Builder pattern that is getting in your way that you have explained, I think we could easily address your concern if we exposed FetchOptions.withDefaults(). Is that right? Thanks, Max On Thu, Apr 1, 2010 at 3:07 AM, Jeff Schnitzer j...@infohazard.org wrote: This is a genuine, heartfelt plea: The Builder pattern (DatastoreServiceConfig, FetchOptions) makes code extra annoying when layering an API on top of the low-level API. Let's say you are writing some code by hand that creates a FetchOptions with a limit and an offset: FetchOptions opts = FetchOptions.Builder.withLimit(100).offset(20); Pretty straightforward when typing it out by hand, but the lack of orthogonality between withLimit() and limit() is a PITA when you're trying to automate the creation of a builder. The problem is, you can't start with a blank FetchOptions. The result is we end up writing lots of code like this: if (limit != null) { if (opts == null) opts = FetchOptions.Builder.withLimit(limit); else opts = opts.limit(limit); } This wouldn't be necessary if FetchOptions.Builder had a create() method that would produce a blank FetchOptions. Or if FetchOptions had a public constructor. Or if FetchOptions was an interface or even a nonfinal class. I notice that DatastoreServiceConfig is following in the path of FetchOptions. My initial reaction was Noo! :-) Thanks for listening, Jeff -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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
Re: [appengine-java] Re: Errors after updating to 1.3.2
The method that can't be found was added in 1.3.2 so, as John says, this is almost certainly a classpath problem. My guess is that you have an old version of appengine-api.jar on your classpath somewhere. On Tue, Mar 30, 2010 at 8:26 PM, Featheast Lee featheast@gmail.comwrote: I tried to do what you mentioned here, but seems no lucky. On Mar 31, 1:21 pm, John Patterson jdpatter...@gmail.com wrote: Looks like you have a class path problem. Do you have different versions of the app engine jars in your WEB-INF/lib dir? On 31 Mar 2010, at 09:18, Featheast Lee wrote: I have updated my app engine to 1.3.2 a couple of days ago, and it runs well on the cloud. Today, when I trying to some testing on my local machine, an exception throws out whenever I try to use the PMF code: PersistenceManager pm = PMF.get().getPersistenceManager(); Basically the exceptions stacks are: Internal Server Error (500) - The server encountered an unexpected condition which prevented it from fulfilling the request Caused by: java.lang.NoSuchMethodError: com .google .appengine .api.datastore.DatastoreServiceFactory.getDatastoreService(Lcom/ google/appengine/api/datastore/DatastoreServiceConfig;)Lcom/google/ appengine/api/datastore/DatastoreService; At first, I thought it is the problem of my newly added code, however, after several attempts, all failed no matter what change i made. Then I thought it might be the issue of SDK, after I switched back my app engine to 1.3.1, it works perfect. But how can the same code runs well in the cloud, but failed in my local machine with different versions? Anyone can give me some idea? Thanks. PS: my test code is a pretty simple client code generate a GET method to the app engine project, and a datastore query will be called, the exception happens when the PMF is called. -- 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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group athttp:// groups.google.com/group/google-appengine-java?hl=en . -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Memory Leak in the EntityManagerFactory?
No problem David, these things happen, and I'm glad to hear you've found the culprit. Thanks for doing all the digging. Max On Mon, Mar 15, 2010 at 2:19 PM, David Fuelling sappe...@gmail.com wrote: Hey Max, I'm eating crow now. Turns out this is *not* a bug in the datastore code. I discovered that one of my DAO parent classes was doing a lookup before it actually created the Entity, and this lookup was getting an EntityManager but not closing it. Turns out my own code was the leak. DOH! Appologies for the false alarm and the waste of time david On Mar 15, 8:00 pm, David Fuelling sappe...@gmail.com wrote: Hey Max, Took a heap dump using two different scenarios. In test 1, I set the - Xmx to 100M, and in test 2 I set the max to 512M, and am comparing the difference between the number of objects across the two memory scenarios. In my code, I'm running a for-loop that executes 5000 times, and most of the objects present in JHat show up no more than 500 times, and in equal amounts, in either memory scenario (leads me to believe these are not the culprits). However, there are a handful of datastore classes that show a 1:1 relationship between the amount of memory I allow in each test. Following are the outputs from JHat: TEST #1 (100M Max) 101489 instances of class com.google.storage.onestore.v3.OnestoreEntity $PropertyValue 101488 instances of class com.google.storage.onestore.v3.OnestoreEntity $Property 52846 instances of class com.google.storage.onestore.v3.OnestoreEntity $Path$Element 43623 instances of class com.google.storage.onestore.v3.OnestoreEntity $Path 29782 instances of class com.google.storage.onestore.v3.OnestoreEntity $Reference 15944 instances of class com.google.apphosting.api.DatastorePb$Query 13839 instances of class com.google.storage.onestore.v3.OnestoreEntity $EntityProto 9237 instances of class com.google.appengine.api.datastore.dev.LocalCompositeIndexManager $IndexComponentsOnlyQuery 6705 instances of class com.google.appengine.api.datastore.dev.LocalDatastoreService $LiveQuery 4613 instances of class com.google.appengine.api.datastore.dev.LocalDatastoreService$Profile $EntityGroup TEST #2 (512M Max) 579558 instances of class com.google.storage.onestore.v3.OnestoreEntity $Property 579558 instances of class com.google.storage.onestore.v3.OnestoreEntity $PropertyValue 25863 instances of class com.google.storage.onestore.v3.OnestoreEntity $Path$Element 24805 instances of class com.google.storage.onestore.v3.OnestoreEntity $Path 17683 instances of class com.google.storage.onestore.v3.OnestoreEntity $Reference 10564 instances of class com.google.apphosting.api.DatastorePb$Query 8441 instances of class com.google.appengine.api.datastore.dev.LocalDatastoreService $LiveQuery 6065 instances of class com.google.storage.onestore.v3.OnestoreEntity $EntityProto 5002 instances of class com.google.appengine.api.datastore.dev.LocalDatastoreService$Profile $EntityGroup From what I can tell, the OnestoreEntity$Property and OnestoreEntity $PropertyValue classes are growing the most (and somewhat linearly) with the number of Datastore operations I execute (capped only by the amount of memory I allow the JVM). Now, my first inclination is to explain my error away on the grounds that the local datastore is in- memory, and so if I don't allow enough JVM memory for my datastore, this is expected behavior. However, I'm only persisting 5,000 User entities (and not even getting that far). My User is not terribly complicated (6 properties, 4 Lists, and a Preferences object). The lists and preferences are Lazy and empty -- I'm not creating anything for these in my test -- just a Userplus I'm only populating one of the field properties (username) with a very short string. For me to run out of 512MB of memory after creating only 4k-ish users means that each of my User entities is taking up around 125k each. Accounting for other datastore components taking up memory, we could say that my entities are only taking up 100k each, leaving the datastore the other 25k, or 100MB of memory. That still seems like my entities are taking up way too much memory (hence some sort of leak?), though I guess I don't know what's going on with the OnestoreEntity class to simulate the datastore, so I can't say for sure. Any thoughts here would be much appreciated. If I can provide any more data for you, please let me know. Thanks! David On Mar 12, 9:37 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Thanks for the report David, this certainly seems suspicious. There is at least one memory leak I'm aware of but it's related to transactions so that's probably not what you're bumping into. Have you tried taking a heap dump to see what exactly is building up
Re: [appengine-java] can not remove with @Order annotation
Please post your model object definitions and the stack trace. Thanks! Max On Sun, Mar 14, 2010 at 8:51 PM, Philip Tucker ptuc...@gmail.com wrote: If I annotate a dependent 1:many relationship with @Order(mappedBy = foo), I get a NPE when I try to remove something from the list. When I remove the annotation everything works fine. Is this a known limitation? If not I can post a stack trace and more details. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Memory Leak in the EntityManagerFactory?
Thanks for the report David, this certainly seems suspicious. There is at least one memory leak I'm aware of but it's related to transactions so that's probably not what you're bumping into. Have you tried taking a heap dump to see what exactly is building up? On Fri, Mar 12, 2010 at 1:27 PM, David Fuelling sappe...@gmail.com wrote: I have a JUnit test class that is attempting to test some JPA datastore create operations, and I'm getting results that *seem* to indicate a memory leak in the EntityManagerFactory (?) Basically, if I use test1a (see below), the heap in use by the JUnit test process continually increases until the JUnit test fails with an OutOfMemory error. Test1b suffers from no such problem. I would not expect this type of behavior from test1a because even though I'm creating a new EntityManager upon every for-loop iteration, that em should go away after every for-loop iteration since the variable reference is replaced with a new EntityManager each time. Now, one might argue that my test is just going too fast, and the GC isn't getting a chance to Garbage Collect. However, Test1a takes a pretty long time to execute on my machine ( 120 seconds), so I *should* be getting some GC, right? Unless the EntityManagerFactory is holding onto a reference to each created EntityManager? Any input here would be much appreciated... Thanks! david ps - my UserImpl is a standard JPA entity. /// //Begin JUnit Test #1a /// User user = null; EntityManager em = null; for (int i = 0; i 5000; i++) { //See how I get an em here: http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Getting_an_EntityManager_Instance em = EMF.get().createEntityManager(); user = new UserImpl(test + i); em.persist(user); em.close(); } /// //End Test #1b /// /// //Begin JUnit Test #1b /// User user = null; EntityManager em = EMF.get().createEntityManager(); for(int i = 0; i 5000; i++) { user = new UserImpl(test + i); em.persist(user); } em.close(); /// //End Test #1b /// -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Error when deleting entities - Id cannot be zero
What version of the sdk are you using? On Fri, Mar 12, 2010 at 1:36 PM, Pavel Byles pavelby...@gmail.com wrote: Anyone? On Fri, Mar 12, 2010 at 8:41 AM, Pavel Byles pavelby...@gmail.com wrote: I'm trying to delete all entities in my datastore but I receive the following error: javax.jdo.JDOUserException: One or more instances could not be deleted... NestedThrowablesStackTrace: java.lang.IllegalArgumentException: id cannot be zero... Caused by:java.lang.IllegalArgumentException: id cannot be zero For the following code: public void deleteAllMyType() { PersistenceManager pm = PMF.get().getPersistenceManager(); Query query = pm.newQuery(MyType.class); try { query.deletePersistentAll(); //ListMyType clist = (ListMyType) query.execute(); //pm.deletePersistentAll(clist); // This doesn't work either } finally { query.closeAll(); pm.close(); } } My entity class looks like this: @PersistenceCapable(identityType = IdentityType.APPLICATION)//, detachable = false) public class MyType implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String name; . . . } -- -Pav -- -Pav -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Error when deleting entities - Id cannot be zero
Which version of the App Engine SDK? On Fri, Mar 12, 2010 at 1:43 PM, Pavel Byles pavelby...@gmail.com wrote: GWT: 2.0.3 On Fri, Mar 12, 2010 at 4:38 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: What version of the sdk are you using? On Fri, Mar 12, 2010 at 1:36 PM, Pavel Byles pavelby...@gmail.comwrote: Anyone? On Fri, Mar 12, 2010 at 8:41 AM, Pavel Byles pavelby...@gmail.comwrote: I'm trying to delete all entities in my datastore but I receive the following error: javax.jdo.JDOUserException: One or more instances could not be deleted... NestedThrowablesStackTrace: java.lang.IllegalArgumentException: id cannot be zero... Caused by:java.lang.IllegalArgumentException: id cannot be zero For the following code: public void deleteAllMyType() { PersistenceManager pm = PMF.get().getPersistenceManager(); Query query = pm.newQuery(MyType.class); try { query.deletePersistentAll(); //ListMyType clist = (ListMyType) query.execute(); //pm.deletePersistentAll(clist); // This doesn't work either } finally { query.closeAll(); pm.close(); } } My entity class looks like this: @PersistenceCapable(identityType = IdentityType.APPLICATION)//, detachable = false) public class MyType implements Serializable { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private String name; . . . } -- -Pav -- -Pav -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- -Pav -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] TransactionalTaskException when enqueuing more than 5 tasks
Yes, the limit is 5: http://code.google.com/appengine/docs/python/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction On Mon, Mar 8, 2010 at 4:10 AM, JD liva...@gmail.com wrote: I am enqueuing tasks within a transaction. tx.begin() for (int i=0;i10;i++) { Queue queue = QueueFactory.getDefaultQueue(); TaskOptions task = url(/taskurl); task.param(param, value); queue.add(task); } tx.commit(); I constantly get TransactionalTaskException when enqueuing task number #6 (everything until number 5 goes through without issues). Is there a limit on the number of tasks which can be enqueued within a transaction ? com.google.appengine.api.labs.taskqueue.TransactionalTaskException at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java: 50) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java: 32) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java: 241) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java: 231) Caused by: java.lang.IllegalArgumentException: at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java: 33) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java: 51) ... 51 more -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] TransactionalTaskException when enqueuing more than 5 tasks
Oops, that was the python link. Java link is http://code.google.com/appengine/docs/java/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction On Mon, Mar 8, 2010 at 10:02 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Yes, the limit is 5: http://code.google.com/appengine/docs/python/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction On Mon, Mar 8, 2010 at 4:10 AM, JD liva...@gmail.com wrote: I am enqueuing tasks within a transaction. tx.begin() for (int i=0;i10;i++) { Queue queue = QueueFactory.getDefaultQueue(); TaskOptions task = url(/taskurl); task.param(param, value); queue.add(task); } tx.commit(); I constantly get TransactionalTaskException when enqueuing task number #6 (everything until number 5 goes through without issues). Is there a limit on the number of tasks which can be enqueued within a transaction ? com.google.appengine.api.labs.taskqueue.TransactionalTaskException at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java: 50) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.makeSyncCall(QueueApiHelper.java: 32) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java: 241) at com.google.appengine.api.labs.taskqueue.QueueImpl.add(QueueImpl.java: 231) Caused by: java.lang.IllegalArgumentException: at com.google.appengine.api.datastore.DatastoreApiHelper.translateError(DatastoreApiHelper.java: 33) at com.google.appengine.api.labs.taskqueue.QueueApiHelper.translateError(QueueApiHelper.java: 51) ... 51 more -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] What is the purpose of keyName? (Low-level API)
On Mon, Feb 22, 2010 at 12:54 PM, Jeff Schnitzer j...@infohazard.orgwrote: I hate to be the dork that argues with the referees, but I'm not fond of this advice... No problem, I'm happy to discuss. * long-id keys can be user-defined just as easily as string-name keys, so you can enforce uniqueness constraints either way if you have some sort of natural key. user-defined long-id keys are not quite as easily used. You either need to commit to not letting the datastore generate ids for that kind or you need to reserve a batch of ids using the DatastoreService.allocateIds method. Otherwise you run the risk of a silent collision. There is no such risk with user-defined string keys. * Readable urls are a high level construct, and it's easy enough to use pretty names mapped to ids using the memcache. If you ever want to be able to rename people, you probably shouldn't use their name as a key! Valid point about renaming, but going back to the example I provided, the datastore does not distinguish between inserts and updates. The only way you can guarantee that an entity was inserted, and therefore the only way you can guarantee the uniqueness of the name, is to use a user-defined key. If you're mapping id to name it will be possible to create two entities with the same name. It's of course up to you to decide how important this is to defend against, but without the ability to provide your own id you wouldn't get to make this choice, and without the ability to provide your own string id you wouldn't be able to add some application-specific meaning to this choice. I'd say that the use case of string name vs numeric id is... is your id a number or is it a string? Boring answer but seems to sum it up pretty well. Jeff On Mon, Feb 22, 2010 at 10:50 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: 1) Readable-urls. http://yourapp.appspot.com/users/max versus http://yourapp.appspot.com/users/192398411324987 2) The datastore doesn't support uniqueness constraints so a user-defined key is the only way you can do a true createIfNonExistent() method: beginTxn(); Entity e; try { e = lookupByKeyName(keyName); } cath (EntityNotFoundException enfe) { e = createNewEntity(keyName); } commitTxn(); The final line throws ConcurrentModificationException if someone else created an entity with the same keyName in between the lookup and the commit. Max On Sun, Feb 21, 2010 at 5:08 PM, DutrowLLC dutrow...@gmail.com wrote: Hi, What is the intended purpose of keyName when creating a new Key or new Entity in the low-level API? What are the proper use cases for keyName? Thanks! Chris -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] What is the purpose of keyName? (Low-level API)
Jeff, I agree with the majority of your design philosophy and the advice you're dispensing, but I still disagree with you on one pretty fundamental point. If I'm understanding your argument correctly, you're saying that best practices for primary key management don't involve user-defined strings, therefore user-defined strings aren't a necessary feature, but I think this ignores a pretty basic usage of uniqueness constraints. Let's say you're a domain registrar, you're building your registration workflow on App Engine, and you need to guarantee that a domain name can only be claimed once. If you use a numeric id mapped to the domain name you run the risk of letting two users reserve the same domain, and if you're a domain registrar that's really really bad. There's no natural key we can bring in here. Whether we as application developers run into them frequently or not, there exists a class of problems where a user-defined string pk is a necessary part of the solution. Regards, Max On Mon, Feb 22, 2010 at 1:52 PM, Jeff Schnitzer j...@infohazard.org wrote: On Mon, Feb 22, 2010 at 1:19 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: user-defined long-id keys are not quite as easily used. You either need to commit to not letting the datastore generate ids for that kind or you need to reserve a batch of ids using the DatastoreService.allocateIds method. Otherwise you run the risk of a silent collision. There is no such risk with user-defined string keys. Right, but if the user has a natural key (long, String, whatever) they won't be using the generator anyways. There are plenty of natural long keys in the world... facebook userid being a popular one. FWIW, Objectify makes the distinction between ids of type Long, which can be null and thus autogenerated, and long (the primitive) which cannot be autogenerated. I really hadn't intended to plug Objectify here, really! Valid point about renaming, but going back to the example I provided, the datastore does not distinguish between inserts and updates. The only way you can guarantee that an entity was inserted, and therefore the only way you can guarantee the uniqueness of the name, is to use a user-defined key. If you're mapping id to name it will be possible to create two entities with the same name. It's of course up to you to decide how important this is to defend against, but without the ability to provide your own id you wouldn't get to make this choice, and without the ability to provide your own string id you wouldn't be able to add some application-specific meaning to this choice. I totally agree with you WRT user-defined vs generated values, I just don't see anything wrong with using the long id as a user-defined value. Just make sure you never ask for a generated one. Seems pretty straightforward. Jeff -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] NullPointerException at Transaction.commit()
Can you please post your model object definitions for Employee and Department? Thanks, Max On Mon, Feb 15, 2010 at 11:53 PM, sushama sush.khadil...@gmail.com wrote: import java.util.List; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.jdo.Transaction; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.Query; import com.google.gwt.user.client.Window; import com.google.gwt.user.server.rpc.RemoteServiceServlet; import com.wissen.enterprisebysush.client.GreetingService; import com.wissen.enterprisebysush.server.domainobject.Department; import com.wissen.enterprisebysush.server.domainobject.Employee; /** * The server side implementation of the RPC service. */ @SuppressWarnings(serial) public class GreetingServiceImpl extends RemoteServiceServlet implements GreetingService { EntityManagerFactory emf = Persistence.createEntityManagerFactory(transactions-optional); public String greetServer(String input) { String serverInfo = getServletContext().getServerInfo(); String userAgent = getThreadLocalRequest().getHeader(User- Agent); return Hello, + input + !brbrI am running + serverInfo + .brbrIt looks like you are using:br + userAgent; } @SuppressWarnings(unchecked) public void addDept(String dept_name, String dept_head) { EntityManager em = null; try { em = emf.createEntityManager(); em.getTransaction().begin(); Department d = new Department(); d.setDept_name(dept_name); d.setHead(dept_head); Query q = em.createQuery(select from com.wissen.enterprisebysush.server.domainobject.Department d); ListDepartment deptList = q.getResultList(); for (Department dept : deptList) { System.out.println(Department name: + dept.getDept_name()); } em.persist(d); } finally { em.getTransaction().commit(); em.close(); } } public void addEmp(String emp_name, String emp_sal, String did) { EntityManager em = emf.createEntityManager(); try { String s = did; EntityTransaction transaction = em.getTransaction(); transaction.begin(); System.out.println(value of Department_name is:: + s); System.out.println(Transaction is active and is::+transaction); //Query q = em.createQuery(select dept_id from com.wissen.enterprisebysush.server.domainobject.Department d where d.dept_name = ?1); //q.setParameter(1, s); //System.out.println(Name of Department is:: + s); //Department dept = (Department) q.getSingleResult(); Query q = em.createQuery(select from com.wissen.enterprisebysush.server.domainobject.Department d); Department dept = (Department) q.getResultList().get(0); System.out.println(Name of Department is:: + dept.getDept_name()); //System.out.println(Query executed Successfully!! + q.getSingleResult()); Employee e = new Employee(); e.setEmp_name(Abdch); e.setEmp_sal(5000); e.setDepartment(dept); em.persist(e); System.out.println(Transaction: + transaction); transaction.commit(); em.close(); } catch (NullPointerException e) { e.printStackTrace(); System.out.println(Exception:: + e.getCause()); } finally { } } } output:: value of Department_name is::Production Transaction is active and is::org.datanucleus.jpa.entitytransactioni...@1a21c7d Name of Department is::Accounts Transaction: org.datanucleus.jpa.entitytransactioni...@1a21c7d java.lang.NullPointerException Exception::null at com.google.appengine.api.datastore.KeyFactory.stringToKey(KeyFactory.java: 181) at org.datanucleus.store.appengine.DatastoreElementContainerStoreSpecialization.extractElementKey(DatastoreElementContainerStoreSpecialization.java: 170) at org.datanucleus.store.appengine.DatastoreAbstractCollectionStoreSpecialization.contains(DatastoreAbstractCollectionStoreSpecialization.java: 57) at org.datanucleus.store.mapped.scostore.AbstractCollectionStore.contains(AbstractCollectionStore.java: 116) at org.datanucleus.sco.backed.List.contains(List.java:455) at org.datanucleus.state.RelationshipManager.processManyToOneBidirectionalRelation(RelationshipManager.java: 690) at org.datanucleus.state.RelationshipManager.process(RelationshipManager.java: 294) at
Re: [appengine-java] How to get testing working with anything other than the default queue
Try this: private final LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalTaskQueueTestConfig()) { @Override protected LocalServerEnvironment newLocalServerEnvironment() { final LocalServerEnvironment lse = super.newLocalServerEnvironment(); return new LocalServerEnvironment() { public File getAppDir() { return new File(dir/with/queues.xml); } public String getAddress() { return lse.getAddress(); } public int getPort() { return lse.getPort(); } public void waitForServerToStart() throws InterruptedException { lse.waitForServerToStart(); } }; } }; On Tue, Feb 16, 2010 at 9:35 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Hi Will, You're loading queue.xml from a different location in your unit tests? This is a use case I didn't thoroughly consider. I can certainly fix this for the next release but let me see if I can find a workaround for you. Thanks, Max On Tue, Feb 16, 2010 at 9:24 AM, Will Bunker w...@thebunkers.com wrote: Prior to version 2.01 I was able to get testing to work with other queues by the following code: LocalTaskQueue ltq = LocalTaskQueueTestConfig.getLocalTaskQueue(); LocalServiceContext ctx = new LocalServiceContext() { public File getAppDir() { Logger.getAnonymousLogger().info(trying to run getAppDir()); File file = new File(war); return file; } }; HashMapString,String prop = new HashMapString,String(); ltq.init(ctx, prop); ltq.start(); You had to tell it where to find the config file queue.xml. Now after upgrading and using private static LocalServiceTestHelper helper = new LocalServiceTestHelper(new LocalTaskQueueTestConfig()); along with: helper.setUp I am getting the old testing errors of: java.lang.IllegalStateException: The specified queue is unknown : How do I get the Queue environment to recognize the queues in the queue.xml file? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: How to get testing working with anything other than the default queue
By default the LocalTaskQueueTestConfig configures the local task queue service to not automatically execute tasks: http://code.google.com/appengine/docs/java/tools/localunittesting/javadoc/com/google/appengine/tools/development/testing/LocalTaskQueueTestConfig.html Or are you saying it's not reading queue.xml? On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker w...@thebunkers.com wrote: Actually it doesn't seem to be reading the queue at all. It is coming from the standard directory in WAR, but doesn't seem to pick it up. I am on Mac OS if that makes any difference. On Feb 16, 9:35 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Hi Will, You're loading queue.xml from a different location in your unit tests? This is a use case I didn't thoroughly consider. I can certainly fix this for the next release but let me see if I can find a workaround for you. Thanks, Max -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: How to get testing working with anything other than the default queue
I see. In the test environment it looks in . by default so if you place queue.xml in the directory from which you're executing the test it should pick it up. On Tue, Feb 16, 2010 at 10:35 AM, Will Bunker w...@thebunkers.com wrote: I am saying that it is not reading queue.xml. I am testing to make sure a certain function puts x number tasks in a queue that is not the default. It doesn't load the queue.xml file unless I use your workaround (then it works great.) On Feb 16, 10:21 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: By default the LocalTaskQueueTestConfig configures the local task queue service to not automatically execute tasks: http://code.google.com/appengine/docs/java/tools/localunittesting/jav... Or are you saying it's not reading queue.xml? On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker w...@thebunkers.com wrote: Actually it doesn't seem to be reading the queue at all. It is coming from the standard directory in WAR, but doesn't seem to pick it up. I am on Mac OS if that makes any difference. On Feb 16, 9:35 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com maxr%2bappeng...@google.com maxr%252bappeng...@google.com wrote: Hi Will, You're loading queue.xml from a different location in your unit tests? This is a use case I didn't thoroughly consider. I can certainly fix this for the next release but let me see if I can find a workaround for you. Thanks, Max -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: How to get testing working with anything other than the default queue
Sorry Will, we look for ./WEB-INF/queue.xml by default. Anyway glad you got it working with the workaround. I'll get this straightened out for the next release. Max On Tue, Feb 16, 2010 at 11:41 AM, Will Bunker w...@thebunkers.com wrote: I put in queue.xml in the test directory and it didn't seem to find it. On Feb 16, 10:47 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: I see. In the test environment it looks in . by default so if you place queue.xml in the directory from which you're executing the test it should pick it up.I On Tue, Feb 16, 2010 at 10:35 AM, Will Bunker w...@thebunkers.com wrote: I am saying that it is not reading queue.xml. I am testing to make sure a certain function puts x number tasks in a queue that is not the default. It doesn't load the queue.xml file unless I use your workaround (then it works great.) On Feb 16, 10:21 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com maxr%2bappeng...@google.com maxr%252bappeng...@google.com wrote: By default the LocalTaskQueueTestConfig configures the local task queue service to not automatically execute tasks: http://code.google.com/appengine/docs/java/tools/localunittesting/jav. .. Or are you saying it's not reading queue.xml? On Tue, Feb 16, 2010 at 10:16 AM, Will Bunker w...@thebunkers.com wrote: Actually it doesn't seem to be reading the queue at all. It is coming from the standard directory in WAR, but doesn't seem to pick it up. I am on Mac OS if that makes any difference. On Feb 16, 9:35 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com maxr%2bappeng...@google.com maxr%252bappeng...@google.com maxr%2bappeng...@google.com maxr%252bappeng...@google.com maxr%252bappeng...@google.com maxr%25252bappeng...@google.com wrote: Hi Will, You're loading queue.xml from a different location in your unit tests? This is a use case I didn't thoroughly consider. I can certainly fix this for the next release but let me see if I can find a workaround for you. Thanks, Max -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com google-appengine-java%252bunsubscr...@googlegroups.comgoogle-appengine-java%25252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: App Engine SDK 1.3.1 is out!
Thanks for making the code available. This looks like an unintentional bug fix to me. There is a hard and fast rule that you can't operate on more than one entity group inside a transaction, so creating and saving two instances of EntityA should always generate an exception because they are both root entities and therefore part of different entity groups. This code _should_ have thrown an exception in 1.3.0 (and earlier), but it didn't. I made some implementation changes to how transactions are managed in 1.3.1 and it looks like I fixed this problem as part of it. Max On Fri, Feb 12, 2010 at 12:10 AM, vori vori...@gmail.com wrote: The following source code has the same problem. - PersistenceManager pm = pmfInstance.getPersistenceManager(); pm.makePersistent(new EntityB(key)); // If this two lines are commented out, pm.getObjectById(EntityB.class, key); // the following code throws exception on sdk1.3.0 too. Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(new EntityA()); pm.makePersistent(new EntityA()); // it throws exception if it compiled using sdk1.3.1. tx.commit(); - Full source code is included in the following repository. Hg repo https://test-gae-j-sdk-131.googlecode.com/hg/ Project page: http://code.google.com/p/test-gae-j-sdk-131/ On 2月12日, 午後4:25, vori vori...@gmail.com wrote: Sorry, I am wrong. I inspected my source code and found the real cause. The following code can works on SDK1.3.0, but it throws java.lang.IllegalArgumentException: can't operate on multiple entity groups in a single transaction. when it used on SDK1.3.1. PersistenceManager pm = pmfInstance.getPersistenceManager(); pm.makePersistent(new EntityB(key)); // If this two lines are commented out, pm.getObjectById(EntityB.class, key); // the following code throws exception on SDK1.3.0 too. ArrayListEntityA entities = new ArrayListEntityA(2); entities.add(new EntityA()); entities.add(new EntityA()); Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistentAll(entities); // it throws exception if it compiled using sdk1.3.1. tx.commit(); Full source code is here.https://test-gae-j-sdk-131.googlecode.com/hg/ On 2月12日, 午前3:11, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Assuming a ClassA object with the specified id already exists, the code you've posted works fine for me. Could you put together a complete example that demonstrates the unexpected behavior? Thanks, Max On Wed, Feb 10, 2010 at 7:49 PM, vori vori...@gmail.com wrote: Is it a bug on JDO of SDK 1.3.1? -- PersistentManager pm = PMF.get().getPersistenceManager();; ClassA classA = pm.getObjectById(ClassA.class, id); ClassB classB = new ClassB(); Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(classB); tx.commit(); // It throws javax.jdo.JDOException: can't operate on multiple entity groups in a single transaction. -- -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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] JDO/JPA Snippets That Work - The Truth About Joins
http://gae-java-persistence.blogspot.com/2010/02/truth-about-joins.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-j...@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.
Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1
Subclassing LocalServiceTestHelper and overriding newEnvironment() should work fine. What does your implementation of newEnvironment() look like? On Wed, Feb 10, 2010 at 7:35 PM, Krishna krishnacal...@gmail.com wrote: Ok! But when I'm using transactions I'm getting: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java: 67) at com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java: 270) I've tried to extend LocalServiceTestHelper and overwrite newEnvironment() with my Environment (who returns appId) but it didn't work... What's wrong? Thanks, Krishna On Feb 10, 10:25 pm, Ikai L (Google) ika...@google.com wrote: We've got a more simple interface for you now. Take a look: http://code.google.com/appengine/docs/java/tools/localunittesting.html 2010/2/10 时空之蕊 skzr@gmail.com I found the class com.google.appengine.tools.development.ApiProxyLocalImpl is not public,but before 1.3.1 it's public! In the JUnit document: import java.io.File; import com.google.appengine.tools.development.ApiProxyLocalImpl; import com.google.apphosting.api.ApiProxy; ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)){}); So I can't new a ApiProxyLocalImpl instance! Any body know how to use JUnit? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp:// googleappengine.blogspot.com|http://twitter.com/app_engine -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: App Engine SDK 1.3.1 is out!
Assuming a ClassA object with the specified id already exists, the code you've posted works fine for me. Could you put together a complete example that demonstrates the unexpected behavior? Thanks, Max On Wed, Feb 10, 2010 at 7:49 PM, vori vori...@gmail.com wrote: Is it a bug on JDO of SDK 1.3.1? -- PersistentManager pm = PMF.get().getPersistenceManager();; ClassA classA = pm.getObjectById(ClassA.class, id); ClassB classB = new ClassB(); Transaction tx = pm.currentTransaction(); tx.begin(); pm.makePersistent(classB); tx.commit(); // It throws javax.jdo.JDOException: can't operate on multiple entity groups in a single transaction. -- -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1
Your code looks fine. Are you sure you're calling setUp() on the LocalServiceTestHelper? On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas krishnacal...@gmail.comwrote: Ooops.. missed your question! It's just: @Override protected Environment newEnvironment() { return new TestEnvironment(); } Thanks, Krishna 2010/2/11 Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com : Subclassing LocalServiceTestHelper and overriding newEnvironment() should work fine. What does your implementation of newEnvironment() look like? On Wed, Feb 10, 2010 at 7:35 PM, Krishna krishnacal...@gmail.com wrote: Ok! But when I'm using transactions I'm getting: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java: 67) at com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java: 270) I've tried to extend LocalServiceTestHelper and overwrite newEnvironment() with my Environment (who returns appId) but it didn't work... What's wrong? Thanks, Krishna On Feb 10, 10:25 pm, Ikai L (Google) ika...@google.com wrote: We've got a more simple interface for you now. Take a look: http://code.google.com/appengine/docs/java/tools/localunittesting.html 2010/2/10 时空之蕊 skzr@gmail.com I found the class com.google.appengine.tools.development.ApiProxyLocalImpl is not public,but before 1.3.1 it's public! In the JUnit document: import java.io.File; import com.google.appengine.tools.development.ApiProxyLocalImpl; import com.google.apphosting.api.ApiProxy; ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)){}); So I can't new a ApiProxyLocalImpl instance! Any body know how to use JUnit? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp://googleappengine.blogspot.com| http://twitter.com/app_engine -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: How to use junit test in the newest SDK1.3.1
Great, glad to hear it! I forgot to add a method to LocalServiceTestHelper to set a custom app id. My mistake. I'll make sure this gets added for the next release so you don't need to provide your own Environment implementation. Max On Thu, Feb 11, 2010 at 10:30 AM, Krishna Caldas krishnacal...@gmail.comwrote: You're right! I refactored my code and forget to annotate the new setUp method with @Before. Sorry for taking your time! It works now. Thanks, Krishna 2010/2/11 Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com : Your code looks fine. Are you sure you're calling setUp() on the LocalServiceTestHelper? On Thu, Feb 11, 2010 at 10:11 AM, Krishna Caldas krishnacal...@gmail.com wrote: Ooops.. missed your question! It's just: @Override protected Environment newEnvironment() { return new TestEnvironment(); } Thanks, Krishna 2010/2/11 Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com : Subclassing LocalServiceTestHelper and overriding newEnvironment() should work fine. What does your implementation of newEnvironment() look like? On Wed, Feb 10, 2010 at 7:35 PM, Krishna krishnacal...@gmail.com wrote: Ok! But when I'm using transactions I'm getting: java.lang.NullPointerException: No API environment is registered for this thread. at com.google.appengine.api.datastore.DatastoreApiHelper.getCurrentAppId(DatastoreApiHelper.java: 67) at com.google.appengine.api.datastore.DatastoreServiceImpl.beginTransaction(DatastoreServiceImpl.java: 270) I've tried to extend LocalServiceTestHelper and overwrite newEnvironment() with my Environment (who returns appId) but it didn't work... What's wrong? Thanks, Krishna On Feb 10, 10:25 pm, Ikai L (Google) ika...@google.com wrote: We've got a more simple interface for you now. Take a look: http://code.google.com/appengine/docs/java/tools/localunittesting.html 2010/2/10 时空之蕊 skzr@gmail.com I found the class com.google.appengine.tools.development.ApiProxyLocalImpl is not public,but before 1.3.1 it's public! In the JUnit document: import java.io.File; import com.google.appengine.tools.development.ApiProxyLocalImpl; import com.google.apphosting.api.ApiProxy; ApiProxy.setDelegate(new ApiProxyLocalImpl(new File(.)){}); So I can't new a ApiProxyLocalImpl instance! Any body know how to use JUnit? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- Ikai Lan Developer Programs Engineer, Google App Enginehttp://googleappengine.blogspot.com| http://twitter.com/app_engine -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group
Re: [appengine-java] Re: getNextID
Both value-strategy of SEQUENCE and the standalone sequences work. See http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/org/datanucleus/test/SequenceExamplesJDO.java and http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/org/datanucleus/store/appengine/JDOSequenceTest.java On Wed, Feb 10, 2010 at 2:55 AM, datanucleus andy_jeffer...@yahoo.comwrote: JDO Sequences work, we just haven't publicized them. Max, you mean value-strategy of SEQUENCE ? I was referring to pm.getSequence(), which maps across to your implementation of StoreManager.getNucleusSequence(). i.e a stand- alone way of having sequences available to the user -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] java.lang.VerifyError
Hi Steve, thanks for bringing this to our attention. We've identified a problem on our end and we're in the process of correcting it. You're of course free to continue using an older version of the SDK, but newer versions are not susceptible to this problem. Max On Tue, Feb 9, 2010 at 5:56 AM, Steve Shrader steveshra...@gmail.comwrote: I have an application that has been deployed and running for several months. Yesterday it began throwing the error java.lang.VerifyError. No new deployments or changes in usage on my side. The code throwing the error is in this method... /** * Retrieve a list of Expense depending on the Dates and Vendor passed in. There will be two * execution paths because Vendor does not need to be passed in as a filter. */ @SuppressWarnings(unchecked) //query is against Expense.class so it will return ListExpense public Liststeveshrader.budget.client.dto.Expense getExpenses(Date startDate, Date endDate, String vendor) { Liststeveshrader.budget.client.dto.Expense dtoExpenses = new ArrayListsteveshrader.budget.client.dto.Expense(); String userId = getUserId(); if(userId != null) { ListExpense expenses = null; PersistenceManager pm = PMF.get().getPersistenceManager(); Query query = pm.newQuery(Expense.class); query.declareImports(import java.util.Date); query.setOrdering(date asc); String queryFilter = userId == userIdParam date = startDateParam date = endDateParam; Map queryParameters = new HashMap(); queryParameters.put(userIdParam, userId); queryParameters.put(startDateParam, startDate); queryParameters.put(endDateParam, endDate); if(vendor != null vendor.trim().length() 0) { //if a vendor passed in queryFilter = queryFilter + vendor == vendorParam; queryParameters.put(vendorParam, vendor); } query.setFilter(queryFilter); expenses = (ListExpense) query.executeWithMap(queryParameters); for(Expense e : expenses) { dtoExpenses.add(new steveshrader.budget.client.dto.Expense(e.getId(), e.getDate(), e.getAmount(), e.getVendor(), e.getExpenseType(), e.getPaymentType())); } pm.close(); } return dtoExpenses; } The complete stack trace is... javax.servlet.ServletContext log: Exception while dispatching incoming RPC call com.google.gwt.user.server.rpc.UnexpectedException: Service method 'public abstract java.util.List steveshrader.budget.client.BudgetService.getExpenses(java.util.Date,java.util.Date,java.lang.String)' threw an unexpected exception: java.lang.VerifyError: org/datanucleus/ store/appengine/query/StreamingQueryResult$1 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.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java: 97) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) 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
Re: [appengine-java] VerifyError on StreamingQueryResult
Thanks for the report. This is indeed the same issue. We're testing a fix now and hope to have this resolved very soon. Max On Tue, Feb 9, 2010 at 4:27 AM, paweł majewski swiatloczuli...@gmail.comwrote: Look similar to http://groups.google.com/group/google-appengine-java/browse_thread/thread/daa540465c4605d/c155d492b8fe89c9?lnk=gstq=StreamingQueryResult%241#c155d492b8fe89c9 app id: swiatlo-czuli gae version: 1.2.1 (?) Uncaught exception from servlet java.lang.VerifyError: org/datanucleus/store/appengine/query/ StreamingQueryResult$1 at org.datanucleus.store.appengine.query.StreamingQueryResult.listIterator(StreamingQueryResult.java: 128) at org.datanucleus.store.appengine.query.StreamingQueryResult.iterator(StreamingQueryResult.java: 120) at pl.simpatico.swiatloczuli.server.supports.FolderSupport.getFoldersTree(FolderSupport.java: 179) at org.apache.jsp.gallery_jsp._jspService(gallery_jsp.java:83) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) 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.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java: 129) at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java: 77) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) at pl.simpatico.swiatloczuli.server.filter.CharEncodingFilter.doFilter(CharEncodingFilter.java: 44) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java: 97) at org.mortbay.jetty.servlet.ServletHandler $CachedChain.doFilter(ServletHandler.java:1084) 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: 135) at com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java: 235) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5485) at com.google.apphosting.base.RuntimePb$EvaluationRuntime $6.handleBlockingRequest(RuntimePb.java:5483) 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:837) at com.google.tracing.LocalTraceSpanRunnable.run(LocalTraceSpanRunnable.java: 56) at com.google.tracing.LocalTraceSpanBuilder.internalContinueSpan(LocalTraceSpanBuilder.java: 536) at com.google.net.rpc.impl.Server.startRpc(Server.java:792) at com.google.net.rpc.impl.Server.processRequest(Server.java:367) at com.google.net.rpc.impl.ServerConnection.messageReceived(ServerConnection.java: 448) 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: 474) at
Re: [appengine-java] Re: getNextID
JDO Sequences work, we just haven't publicized them. The DataNucleus docs should tell you everything you need to know: http://www.datanucleus.org/products/accessplatform/jdo/sequences.html IdGeneratorStrategy.INCREMENT is not yet implemented. What are you looking to use it for? Max On Mon, Feb 8, 2010 at 3:20 AM, Vincent TELLIER tellier.vinc...@gmail.comwrote: I tried the incrementation, but I got an error saying that it was not implemented in the appengine datastore. TELLIER Vincent + Email : cont...@tellier-vincent.eu + Contact messenger (msn) : abs...@esugenus.fr 2010/2/8 aswath satrasala aswath.satras...@gmail.com See if the following annotation help you. @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT) -Aswath On Mon, Feb 8, 2010 at 1:18 AM, datanucleus andy_jeffer...@yahoo.comwrote: What getNextID feature on JDO ? i.e please make reference to the JDO API and which particular API Method you're referring to -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: getNextID
Hi Aswath, Unfortunately there is no way to guarantee the assignment of sequential ids using JDO on App Engine, or even using the low-level datastore api. This is because ids are allocated in batches across many datastore backends, and one request to get the next id may hit one backend while another may hit a different backend. Is sequential ids a hard requirement? Max On Tue, Feb 9, 2010 at 8:27 PM, aswath satrasala aswath.satras...@gmail.com wrote: Hello Max, I am planning to use IdGeneratorStrategy.INCREMENT feature to assign sequential ids for entities I am creating. for example, Employee. -Aswath On Wed, Feb 10, 2010 at 5:49 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: JDO Sequences work, we just haven't publicized them. The DataNucleus docs should tell you everything you need to know: http://www.datanucleus.org/products/accessplatform/jdo/sequences.html IdGeneratorStrategy.INCREMENT is not yet implemented. What are you looking to use it for? Max On Mon, Feb 8, 2010 at 3:20 AM, Vincent TELLIER tellier.vinc...@gmail.com wrote: I tried the incrementation, but I got an error saying that it was not implemented in the appengine datastore. TELLIER Vincent + Email : cont...@tellier-vincent.eu + Contact messenger (msn) : abs...@esugenus.fr 2010/2/8 aswath satrasala aswath.satras...@gmail.com See if the following annotation help you. @Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT) -Aswath On Mon, Feb 8, 2010 at 1:18 AM, datanucleus andy_jeffer...@yahoo.comwrote: What getNextID feature on JDO ? i.e please make reference to the JDO API and which particular API Method you're referring to -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Task queues and transaction support
Hi JD, We released the api for this feature ahead of the backend support so you'll need to wait for the next release (currently making its way through QA) to be able to take advantage of transactional tasks. Once the feature is enabled, tasks that are added to queues when there is an active datastore transaction will be automatically enlisted in the datastore transaction so most of the time you won't actually need to get ahold of the active com.google.appengine.api.datastore.Transaction. That said, you can always get ahold of the active datastore transaction via DatastoreService.getCurrentTransaction(). Hope this helps, Max On Mon, Jan 25, 2010 at 5:11 PM, JD liva...@gmail.com wrote: The Queue interface has a method: TaskHandle add(Transaction txn, TaskOptions taskOptions) How does one get a handle on com.google.appengine.api.datastore.Transaction in the first place ? The persistent manager only returns a transaction of type javax.jdo.Transaction which is not compatible with com.google.appengine.api.datastore.Transaction expected by the task queue API. Is this a bug ? JD -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Wildcard must appear at the end of the expression string (only prefix matches are supported)
Thanks for the report Steve, looks like a bug. The information in the error message is still relevant though. The datastore does not support real regular expression matching, but rather just startsWith filters. So, if your regex can be rewritten to use GrpName.startsWith() then you can use that as your workaround, but if it can't be written this way then the datastore won't be able to fulfill this query even once this bug is fixed. Sorry for the trouble, Max On Wed, Jan 13, 2010 at 3:42 AM, Steve Pritchard steve...@gmail.com wrote: I get this exception. viewItemByQuery Exception:org.datanucleus.store.appengine.query.DatastoreQuery $UnsupportedDatastoreFeatureException: Problem with query SELECT FROM com.rsi.gems.bbb.gdo.GdoSysGroups WHERE this.GrpName.matches(.*): Wildcard must appear at the end of the expression string (only prefix matches are supported) The Datanucleus doc clearly states this is a String Regex expression which is what I have. To quote: Returns whether string matches the passed expression. The pattern argument follows the rules of java.lang.String.matches method. How do I proceed? Steve -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null
Hi Kemal, thanks for the report. I can reproduce the exception and I can make the exception go away by removing the column = F_PK attributes from the @Persistent annotations. I don't yet know why this is causing a problem but overriding the name of a primary key column doesn't do anything (the primary key is always mapped to the Entity key, not a named property on the Entity), so removing them shouldn't hurt. Max On Thu, Jan 7, 2010 at 10:20 AM, Kemal Dogan kemal.m...@gmail.com wrote: is there any solution for this problem? On Thu, Dec 31, 2009 at 8:46 PM, Kemal Dogan kemal.m...@gmail.com wrote: hi, I have two entity with owned relation. Order is master entity and OrderItem is child entity. When I have to persist Order without OrderItem, but it gives an exception (javax.jdo.JDOException: Unexpected error during precommit) at commit line. But if I add an OrderItem instance to orderItemChilds, then it works. My sample code is at below, how can I solve this problem. Please help. Kemal Dogan. --- My Codes: Master Entity: @PersistenceCapable(identityType = IdentityType.APPLICATION, table = T_Order, detachable = true) @Inheritance(customStrategy = complete-table) public class Order extends MasterEntityImpl { @Persistent(mappedBy = order) @Element(dependent = true) @javax.jdo.annotations.Order(extensions = @Extension(vendorName = datanucleus, key = list-ordering, value = pk asc)) private ListOrderItem orderItemChilds = new ArrayList(); ... Child Entity: @PersistenceCapable(identityType = IdentityType.APPLICATION, table = T_OrderItem, detachable = true) public class OrderItem extends ChildEntityImplOrder { @Persistent private Order order; ... DAO code: public void test_With_ERROR() { OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO(); Order order= new Order(); orderDAO.persist(order); } public void test_With_NO_ERROR() { OrderDAO orderDAO = DAOFactory.getInstance().getOrderDAO(); Order order= new Order(); ListOrderItem orderItems= (ListOrderItem) order.getOrderItemChilds(); OrderItem item= new OrderItem(); orderItems.add(item); orderDAO.persist(order); } . Other abtract classes. @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class MasterEntityImpl implements MasterEntityKey { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column = F_PK) private Key pk; ... @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class ChildEntityImplT extends MasterEntity implements ChildEntityT,Key { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY, column = F_PK) private Key pk; ... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Unexpected error during precommit, with owned relation, if childList is null
Fixed in trunk On Tue, Jan 12, 2010 at 12:56 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Sure, glad I could help. On Tue, Jan 12, 2010 at 12:52 PM, Kemal Dogan kemal.m...@gmail.comwrote: hi max, thanks you very much. On Tue, Jan 12, 2010 at 10:44 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Filed http://code.google.com/p/datanucleus-appengine/issues/detail?id=188 ... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] No JDO support for datanucleus ObjectStringConverter?
I'm sorry to report that we have not yet hooked in support for ObjectStringConverter. It shouldn't be too difficult though and I can definitely see how it would be useful. Please file an issue and we'll get to it as soon as we can. http://code.google.com/p/datanucleus-appengine/issues/list Thanks, Max On Fri, Jan 8, 2010 at 3:47 PM, inetdevboy inetdev...@gmail.com wrote: I wrote a datanucleus javaTypes plugin (for joda-time LocalDate) based on the org.datanuclues.store.types.ObjectStringConverter interface. You probably know that this interface allows non-basic types to declare their ability to marshal themselves to/from a String representation for persistence. In my case it'd be particularly helpful because the String representation's natural sort order matches the sort order of the class itself, so it'd be indexable. The datanucleus layer seems to find and register the plugin, because I get this FINE debug line when I include my plugin: Jan 8, 2010 8:47:42 PM org.datanucleus.store.types.TypeManager addJavaType FINE: Adding support for Java type org.joda.time.LocalDate (persistent=true, DFG=true, embedded=true) But when it tries to persist a field of type LocalDate I still get the following stack, with or without my plugin: java.lang.IllegalArgumentException: eventDate: org.joda.time.LocalDate is not a supported property type. at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedSingleValue (DataTypeUtils.java:145) at com.google.appengine.api.datastore.DataTypeUtils.checkSupportedValue (DataTypeUtils.java:127) at com.google.appengine.api.datastore.Entity.setProperty(Entity.java: 280) at org.datanucleus.store.appengine.DatastoreFieldManager.storeObjectField (DatastoreFieldManager.java:798) at org.datanucleus.state.AbstractStateManager.providedObjectField (AbstractStateManager.java:1037) at com.inetdevboy.model.Event.jdoProvideField(Event.java) at com.inetdevboy.model.Event.jdoProvideFields(Event.java) [more]... I'd really like to avoid having to declare separate persistence fields with lifecycle listeners to accommodate every LocalDate field. Is there a lever in the existing GAE implementation I haven't pulled to engage my plugin? BTW, I'm aware that there's an existing JodaTime datanucleus plugin, but it appears to require DataNucleus 2, and my implementation is essentially the same as theirs, just without the ORM support. Please help! [Using GAE SDK 1.3.0] -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Persist/query test.test1.Test and test.test2.Test
By default the kind of the datastore entity is derived from the simple name of the class, and test.test1.Test.class.getSimpleName() is the same as test.test2.Test.class.getSimpleName(). This is documented here: http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Class_and_Field_Annotations If you need to persist two classes in different packages but with the same name you can override the kind like this: @PersistenceCapable(table = SomethingElse) public class Test { // ... } Hope this helps, Max On Fri, Jan 8, 2010 at 3:45 PM, w windic...@gmail.com wrote: I have two persistable classes: test.test1.Test and test.test2.Test, but I can't persist/query objects of these classes right. There is a simple example shows wrong behavior: test.TestServlet.java: package test; import java.io.IOException; import javax.jdo.JDOHelper; import javax.jdo.PersistenceManager; import javax.jdo.PersistenceManagerFactory; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class TestServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { PersistenceManager pm = pmFactory.getPersistenceManager(); pm.makePersistent(new test.test1.Test(1, test1)); pm.close(); pm = pmFactory.getPersistenceManager(); pm.makePersistent(new test.test2.Test(1, test2)); pm.close(); pm = pmFactory.getPersistenceManager(); response.getWriter().println(RESULT: + pm.getObjectById (test.test1.Test.class, 1)); pm.close(); } public static final PersistenceManagerFactory pmFactory = JDOHelper.getPersistenceManagerFactory(transactions-optional); } test.test1.TestServlet.java and test.test2.TestServlet.java are the same except package name, so I missed it: import javax.jdo.annotations.*; @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Test { public Test(String id, String data) { this.id = id; this.data = data; } public String toString() { return getClass().getName() + : id= + id + data= + data; } @PrimaryKey private String id; @Persistent private String data; } Surprising result I got is following: RESULT: test.test1.Test: id=1 data=test2 Expected result: RESULT: test.test1.Test: id=1 data=test1 -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] multiple contains() clauses on the same table
Thanks for the report, looks like a bug. Multiple contains() clauses are fine but I didn't properly account for the case where one of the clauses is on the primary key of the object. The fix should be straightforward but let me see if I can get you a workaround. Max On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle rrmu...@gmail.com wrote: Basically i have 3 fields in the same table to select by using .contains() clauses - one is the primary key field so :keyList (java.util.SetKey) , :feedTypes (java.util.SetInteger) :contentTypes(java.util.SetInteger) with values i need to select with. The Feed object (and the relevant fields) is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Feed { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; ... @Persistent private int typeFeed ; @Persistent private int typeContent = CONTENT_TYPE_NOTCHECKED; } so i try this Query query1 = pm.newQuery(Feed.class); query1.setFilter(:keyList.contains(id) :feedTypes.contains (typeFeed) :contentTypes.contains(typeContent)); query1.setRange(0,500); MapString, Collection paramsf = new HashMapString, Collection(); paramsf.put(keyList, feedIds); paramsf.put(feedTypes, feedTypes); paramsf.put(contentTypes, contentTypes); feeds = (ListFeed) query1.executeWithMap(paramsf); and i get javax.jdo.JDOFatalUserException: Batch lookup by primary key is only supported if no other filters and no sort orders are defined. Is there any way around it - from other posts it looks like subqueries an the IN syntax arent supported. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] multiple contains() clauses on the same table
I'm really sorry but I've been unable to construct an equivalent query that avoids this bug. If the size of keyList isn't too large I'd recommend executing a batch get to retrieve all those objects by id and then applying the rest of your filter in-memory. Sorry for the trouble. Max On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Thanks for the report, looks like a bug. Multiple contains() clauses are fine but I didn't properly account for the case where one of the clauses is on the primary key of the object. The fix should be straightforward but let me see if I can get you a workaround. Max On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle rrmu...@gmail.com wrote: Basically i have 3 fields in the same table to select by using .contains() clauses - one is the primary key field so :keyList (java.util.SetKey) , :feedTypes (java.util.SetInteger) :contentTypes(java.util.SetInteger) with values i need to select with. The Feed object (and the relevant fields) is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Feed { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; ... @Persistent private int typeFeed ; @Persistent private int typeContent = CONTENT_TYPE_NOTCHECKED; } so i try this Query query1 = pm.newQuery(Feed.class); query1.setFilter(:keyList.contains(id) :feedTypes.contains (typeFeed) :contentTypes.contains(typeContent)); query1.setRange(0,500); MapString, Collection paramsf = new HashMapString, Collection(); paramsf.put(keyList, feedIds); paramsf.put(feedTypes, feedTypes); paramsf.put(contentTypes, contentTypes); feeds = (ListFeed) query1.executeWithMap(paramsf); and i get javax.jdo.JDOFatalUserException: Batch lookup by primary key is only supported if no other filters and no sort orders are defined. Is there any way around it - from other posts it looks like subqueries an the IN syntax arent supported. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] multiple contains() clauses on the same table
Issued filed: http://code.google.com/p/datanucleus-appengine/issues/detail?id=185 On Fri, Jan 8, 2010 at 10:12 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: I'm really sorry but I've been unable to construct an equivalent query that avoids this bug. If the size of keyList isn't too large I'd recommend executing a batch get to retrieve all those objects by id and then applying the rest of your filter in-memory. Sorry for the trouble. Max On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Thanks for the report, looks like a bug. Multiple contains() clauses are fine but I didn't properly account for the case where one of the clauses is on the primary key of the object. The fix should be straightforward but let me see if I can get you a workaround. Max On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle rrmu...@gmail.com wrote: Basically i have 3 fields in the same table to select by using .contains() clauses - one is the primary key field so :keyList (java.util.SetKey) , :feedTypes (java.util.SetInteger) :contentTypes(java.util.SetInteger) with values i need to select with. The Feed object (and the relevant fields) is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Feed { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; ... @Persistent private int typeFeed ; @Persistent private int typeContent = CONTENT_TYPE_NOTCHECKED; } so i try this Query query1 = pm.newQuery(Feed.class); query1.setFilter(:keyList.contains(id) :feedTypes.contains (typeFeed) :contentTypes.contains(typeContent)); query1.setRange(0,500); MapString, Collection paramsf = new HashMapString, Collection(); paramsf.put(keyList, feedIds); paramsf.put(feedTypes, feedTypes); paramsf.put(contentTypes, contentTypes); feeds = (ListFeed) query1.executeWithMap(paramsf); and i get javax.jdo.JDOFatalUserException: Batch lookup by primary key is only supported if no other filters and no sort orders are defined. Is there any way around it - from other posts it looks like subqueries an the IN syntax arent supported. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] [ANN] DataNucleus AccessPlatform 2.0 released
Congrats on the release Andy! The App Engine DataNucleus plugin is not going to work out-of-the-box with DN 2.0 so please wait until we (Google) update our stuff. This is going to take some time for us but we will get it taken care of. Max On Fri, Jan 8, 2010 at 9:44 AM, Rusty Wright rwright.li...@gmail.comwrote: If we're getting the DataNucleus jars by way of maven dependencies, do you recommend that we wait until Google updates their stuff before we use 2.0 or can we start using your 2.0 version now? datanucleus wrote: The next generation of DataNucleus AccessPlatform has now been released. This includes much internal restructuring and API changes to simplify future directions, as well as many feature additions, including support for more datastore types. Of the things that impact on GAE/J usage : non-tx persist/delete operations are now atomic, L2 cached is enabled by default, support for singleton PMF/EMF pattern, preview for many JPA2 features, full support for JDO2.3 features, auto- generation of primary key classes during enhancement, support for persistence of JodaTime types, ability to cache query compilations and query results, and many other things. Obviously, the current version of the GAE/J DataNucleus plugin doesn't support this version of DataNucleus yet, but if any of the items listed above would be desirable to your project then I suggest that you star the following issue http://code.google.com/p/datanucleus-appengine/issues/detail?id=103colspec=ID%20Stars%20Type%20Status%20Priority%20FoundIn%20TargetRelease%20Owner%20Summary -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] multiple contains() clauses on the same table
Fixed in trunk. On Fri, Jan 8, 2010 at 10:31 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Issued filed: http://code.google.com/p/datanucleus-appengine/issues/detail?id=185 On Fri, Jan 8, 2010 at 10:12 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: I'm really sorry but I've been unable to construct an equivalent query that avoids this bug. If the size of keyList isn't too large I'd recommend executing a batch get to retrieve all those objects by id and then applying the rest of your filter in-memory. Sorry for the trouble. Max On Fri, Jan 8, 2010 at 9:48 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Thanks for the report, looks like a bug. Multiple contains() clauses are fine but I didn't properly account for the case where one of the clauses is on the primary key of the object. The fix should be straightforward but let me see if I can get you a workaround. Max On Thu, Jan 7, 2010 at 7:06 PM, siliconeagle rrmu...@gmail.com wrote: Basically i have 3 fields in the same table to select by using .contains() clauses - one is the primary key field so :keyList (java.util.SetKey) , :feedTypes (java.util.SetInteger) :contentTypes(java.util.SetInteger) with values i need to select with. The Feed object (and the relevant fields) is @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Feed { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; ... @Persistent private int typeFeed ; @Persistent private int typeContent = CONTENT_TYPE_NOTCHECKED; } so i try this Query query1 = pm.newQuery(Feed.class); query1.setFilter(:keyList.contains(id) :feedTypes.contains (typeFeed) :contentTypes.contains(typeContent)); query1.setRange(0,500); MapString, Collection paramsf = new HashMapString, Collection(); paramsf.put(keyList, feedIds); paramsf.put(feedTypes, feedTypes); paramsf.put(contentTypes, contentTypes); feeds = (ListFeed) query1.executeWithMap(paramsf); and i get javax.jdo.JDOFatalUserException: Batch lookup by primary key is only supported if no other filters and no sort orders are defined. Is there any way around it - from other posts it looks like subqueries an the IN syntax arent supported. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Query with inequality operators on a single property fails
Implicit parameters need to be prefixed with a ':' query.setFilter(dueDate = :beginDateParam dueDate = :endDateParam); Max On Tue, Jan 5, 2010 at 10:53 AM, dantuluri pdantul...@gmail.com wrote: Hi, I have the following query with inequality operators on a single property: query = pm.newQuery(File.class); query.setFilter(dueDate = beginDateParam dueDate = endDateParam); ListFile storedFiles = (ListFile)query.executeWithArray(begin, end); Runtime is throwing this exception: java.lang.RuntimeException: org.datanucleus.store.appengine.query.DatastoreQuery $UnsupportedDatastoreFeatureException: Problem with query SELECT FROM Flow WHERE dueDate = beginDateParam dueDate = endDateParam: Operator = cannot be used as part of the join condition. Use 'contains' if joining on a Collection field and equality if joining on a single-value field. AppEngine documentation clearly says it supports inequality operators on a single property. Following is the quote from the documentation: Inequality Filters Are Allowed On One Property Only A query may only use inequality filters (, =, =, , !=) on one property across all of its filters. For example, this query is allowed: select from Person where birthYear = minBirthYearParam birthYear = maxBirthYearParam Can anyone with App Engine experience please explain whats wrong with this query? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] SUBSTRING function for JPA
It's not implemented. Could you please file a bug? http://code.google.com/p/datanucleus-appengine/issues/list Thanks, Max On Sun, Jan 3, 2010 at 7:16 AM, Wong lhw...@gmail.com wrote: SUBSTRING function for JPA is not working. entityManager.createQuery(SELECT SUBSTRING(v.name, 1, 3) from Venue v) return v.name but NOT the substring. Anyone has any idea? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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] JDO/JPA Snippets That Work - More compact @PersistenceCapable declarations
http://gae-java-persistence.blogspot.com/2009/12/more-compact-persistencecapable.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-j...@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.
Re: [appengine-java] Simple one to many problem!!!
I'd recommend basing your code on the example here to get something working: http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html Then you can start tweaking. Max On Wed, Dec 30, 2009 at 3:02 PM, markm208 markm...@gmail.com wrote: I am thoroughly confused… I am trying to set up a simple one to many relationship using JPA, I think that this should work but instead I get the error Primary key for object of type Member is null. Any help would be greatly appreciated. @Entity(name = Member) public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; @Basic //datastore specific type private Email memberEmail; private String memberPassword; private String memberFirstName; private String memberLastName; @Basic //blob of text not searchable private Text memberDescription; //Member 'owns' the Searches @OneToMany(mappedBy = memberWhoCreated, cascade=CascadeType.ALL) private List Search searches = new ArrayList Search (); //getters and setters //... } @Entity(name = Search) public class Search { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; private List String searchStrings; private boolean allowOthersToSee; @Basic //datastore specific type private Text contextOfSearch; @ManyToOne(fetch = FetchType.LAZY) private Member memberWhoCreated; public static Search createASearch(boolean allowOthersToSee, String context, Member member) { Search search = null; EntityManager em = null; try { //get the entity manager em = EMF.get().createEntityManager(); //create the search from the form variables search = new Search(); search.setAllowOthersToSee(allowOthersToSee); search.setContextOfSearch(new Text(context)); search.setMemberWhoCreated(member); em.getTransaction().begin(); try { //store the member em.persist(search); em.getTransaction().commit(); } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } } } finally { em.close(); } return search; } //getters and setters //... } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Simple one to many problem!!!
The difference between your code and the code in the blog post is that you're calling em.persist() on the child object but the blog post is calling em.persist() on the parent object. If you want to take advantage of implicit entity group assignment it's important to manage children via their parents. If you switch em.persist(search) to em.persist(member) you should be fine. Max On Wed, Dec 30, 2009 at 3:22 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: I'd recommend basing your code on the example here to get something working: http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html Then you can start tweaking. Max On Wed, Dec 30, 2009 at 3:02 PM, markm208 markm...@gmail.com wrote: I am thoroughly confused… I am trying to set up a simple one to many relationship using JPA, I think that this should work but instead I get the error Primary key for object of type Member is null. Any help would be greatly appreciated. @Entity(name = Member) public class Member { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; @Basic //datastore specific type private Email memberEmail; private String memberPassword; private String memberFirstName; private String memberLastName; @Basic //blob of text not searchable private Text memberDescription; //Member 'owns' the Searches @OneToMany(mappedBy = memberWhoCreated, cascade=CascadeType.ALL) private List Search searches = new ArrayList Search (); //getters and setters //... } @Entity(name = Search) public class Search { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key id; private List String searchStrings; private boolean allowOthersToSee; @Basic //datastore specific type private Text contextOfSearch; @ManyToOne(fetch = FetchType.LAZY) private Member memberWhoCreated; public static Search createASearch(boolean allowOthersToSee, String context, Member member) { Search search = null; EntityManager em = null; try { //get the entity manager em = EMF.get().createEntityManager(); //create the search from the form variables search = new Search(); search.setAllowOthersToSee(allowOthersToSee); search.setContextOfSearch(new Text(context)); search.setMemberWhoCreated(member); em.getTransaction().begin(); try { //store the member em.persist(search); em.getTransaction().commit(); } finally { if (em.getTransaction().isActive()) { em.getTransaction().rollback(); } } } finally { em.close(); } return search; } //getters and setters //... } -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Unindexed property
Looks like you're using the JPA Extension annotation. If you're using JDO, use javax.jdo.annotations.Extension. On Wed, Dec 23, 2009 at 8:50 AM, Peter Ondruska peter.ondru...@gmail.comwrote: I have set few properties unindexed like this: @Persistent @Extension(vendorName = datanucleus, key = gae.unindexed, value = true) private Float amount = 1.0f; But I get this exception: org.datanucleus.jdo.metadata.JDOAnnotationReader processMemberAnnotations: Class/Field amount has an annotation org.datanucleus.jpa.annotations.Extension which was not processed. Is it OK and shall I adjust logging: DataNucleus.jdo.metadata.JDOAnnotationReader.level=OFF Or is there any other/better way? Am I not going to miss other exceptions in JDOAnnotationReader? 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] StackOverFlowError on JPA Remove() with @OneToMany and abstract base classes.
Workaround posted to the bug. Thanks! On Sun, Dec 20, 2009 at 6:22 AM, David Fuelling sappe...@gmail.com wrote: I'm pretty sure my issue is a bug, but upon further reflection I figured I'd bring it to light here in the discussion groups just to be sure. Here's the issue, with test code: http://code.google.com/p/googleappengine/issues/detail?id=2541 Basically, I'm trying to model a User entity that has more than 5,000 tags (Strings). Since the GAE datastore can't store more than 5,000 strings in a List attribute, I'm following the design pattern outlined in this Google Tech Talk (basically, have the User entity hold a List of Entity's, each of which hold a ListString. The 5000+1 string gets put into the 2nd TagReferenceEntity in the User): http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine I'm using JPA to implement this setup, and everything works except for delete operations. The google-code issue contains a stack-trace and an attached .zip file with code to reproduce the problem (main error is java.lang.StackOverflowError). Thanks! david -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Any advantages on using the Key type instead of String or Long for PK
Please note that you can still query a Key primary key using comparison, you just can't do it the exact way you've written your example: pm.newQuery(select from Person where key = :p).execute(person.getKey()); On Tue, Dec 22, 2009 at 6:30 AM, Michael Chan hsmc...@gmail.com wrote: Thanks a lot! On 22 Dec 2009, at 14:16, datanucleus wrote: Is that mean that using a String type is not a bad thing to do? From a pure persistence point of view, using a portable type (Long, String etc) makes total sense, since your classes aren't tied to GAE. Obviously Google may have some hidden functionality in their Key but thats for them to comment on -- 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.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en . -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] IdGeneratorStrategy.SEQUENCE
Hi Philip, IdGeneratorStrategy.SEQUENCE support is implemented on top of DatastoreService.allocateIds(), which is itself the mechanism that the datastore uses internally to assign ids. So, all properties of datastore id allocation apply to SEQUENCE. There is a lot of good information about these properties in this thread: http://groups.google.com/group/google-appengine/browse_thread/thread/dec83c2dbd9542e4 But in short, sequences are guaranteed to be unique but not monotically increasing. Hope this helps, Max On Mon, Dec 21, 2009 at 12:04 AM, Philip Tucker ptuc...@gmail.com wrote: I'm using IdGeneratorStrategy.SEQUENCE for the primary key of a table, but it appears AppEngine bounces between 2 different sequence generators as I create new entries. IDs are unique, but not monotonically increasing. It's possible I've coded something wrong, but I'm oretty sure this is a bug. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: IdGeneratorStrategy.SEQUENCE
Where are you reading the definition of the contract? On Mon, Dec 21, 2009 at 2:41 PM, Philip Tucker ptuc...@gmail.com wrote: Thanks! Unless I'm misreading the documentation for SEQUENCE, that breaks the contract of the JDP annotation API, doesn't it? Is there a way to annotate a field as a true sequence, or do I need to create my own sequence and assign the value myself? On Dec 21, 9:29 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Hi Philip, IdGeneratorStrategy.SEQUENCE support is implemented on top of DatastoreService.allocateIds(), which is itself the mechanism that the datastore uses internally to assign ids. So, all properties of datastore id allocation apply to SEQUENCE. There is a lot of good information about these properties in this thread: http://groups.google.com/group/google-appengine/browse_thread/thread/... But in short, sequences are guaranteed to be unique but not monotically increasing. Hope this helps, Max On Mon, Dec 21, 2009 at 12:04 AM, Philip Tucker ptuc...@gmail.com wrote: I'm using IdGeneratorStrategy.SEQUENCE for the primary key of a table, but it appears AppEngine bounces between 2 different sequence generators as I create new entries. IDs are unique, but not monotonically increasing. It's possible I've coded something wrong, but I'm oretty sure this is a bug. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B unsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] preparedQuery.asQueryResultList and Cursor
Hi Laco, We're actively working on the Cursors feature but it's not finished yet. The api for this feature went out in the latest SDK but the backend changes did not, which explains the exceptions you're seeing. Cursors will be available in our next release, due out early next year. Thanks, Max On Thu, Dec 17, 2009 at 5:55 AM, Laco Skokan sko...@gmail.com wrote: Hello, I am trying to use Cursors for pagination and it does not seems to work on local sdk 1.3.0. It fails on this row: cursor = preparedQuery.asQueryResultList(withLimit(10)).getCursor() error: groovy.lang.MissingMethodException: No signature of method: com.google.appengine.api.datastore.DatastoreServiceImpl $PreparedQueryImpl.asQueryResultList() is applicable for argument types: (com.google.appengine.api.datastore.FetchOptions) values: [com.google.appengine.api.datastore.fetchopti...@a00fd] Interesting is, that the error is different on the online version for the engine. There is no error, just the cursor is null. Any idea? Ladislav. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] com.google.appengine.api.datastore.Text with JPA
Try adding @Basic. More info here: http://code.google.com/appengine/docs/java/datastore/usingjpa.html#Class_and_Field_Annotations On Tue, Dec 15, 2009 at 11:55 PM, Compi lauwers@gmail.com wrote: Hey Everyone, I can't seem to get this working. How do you save and read com.google.appengine.api.datastore.Text in google appengine with JPA, NOT JDO!! I have a simple POJO (Simplified example): import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import com.google.appengine.api.datastore.Text; @Entity public class NewsItem implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private Text content; private Date created; private String title; private String user; public NewsItem(Text content, Date created, String title, String user) { super(); this.content = content; this.created = created; this.title = title; this.user = user; } public Text getContent() { return content; } public void setContent(Text content) { this.content = content; } } Which I save in my dao: @Repository(newsItemDao) @Transactional public class NewsItemDao implements DaoNewsItem { private EntityManager entityManager = EMF.getEntityManager(); @Override public void save(NewsItem entity) { EntityTransaction tx = entityManager.getTransaction(); tx.begin(); entityManager.persist(entity); entityManager.flush(); clearCache(); tx.commit(); } } But in my dashboard I can't find the content, so I think it's not saved, and so I can't retrieve it. Can someone help me. Thx Compi -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: TaskQueue and null host name
Yup, it's a bug. Would you mind filing it in the issue tracker? I'll get it sorted out for the next release. Thanks, Max On Wed, Dec 16, 2009 at 9:34 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Interesting, let me take a look. On Tue, Dec 15, 2009 at 6:47 PM, Millisecond millisec...@gmail.comwrote: It's in a normal doGet method of a servlet. Re-enabled it to double-check that I was failing on the version in doGet (originally I had it in an init() method) and ran into something that may be the cause. If I request the servlet from http://localhost:8080/ it fails, the same servlet also responds to http://localhost:8080/Index and there it works fine. I can't see anything in my code making it fail from the bare URL, but there is a fair amount going on in that servlet. I was just doing it there for expediency while testing, can't see any good reason to enqueue something from / anyway so should be fine. Thanks, -C On Dec 15, 6:26 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Where is your code that adds the task to the queue? Is it being run during server initializaiton, perhaps as part of a static block or a LoadOnStartup servlet? Thanks, Max On Tue, Dec 15, 2009 at 8:27 AM, Millisecond millisec...@gmail.com wrote: Hello, I'm just testing out super basic TaskQueue stuff in the dev environment and running into an exception I just can't seem to shake. Code: Queue queue = QueueFactory.getQueue(mail-queue); queue.add(url(/api/RunMonitor)); Exception: java.lang.IllegalArgumentException: Host name may not be null at org.apache.commons.httpclient.HttpHost.init(Unknown Source) at org.apache.commons.httpclient.HttpHost.init(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.init(Unknown Source) at org.apache.commons.httpclient.methods.ExpectContinueMethod.init (Unknown Source) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.init (Unknown Source) at org.apache.commons.httpclient.methods.PostMethod.init(Unknown Source) at com.google.appengine.api.urlfetch.dev.LocalURLFetchService $RedirectablePostMethod.init(LocalURLFetchService.java:348) at com.google.appengine.api.urlfetch.dev.LocalURLFetchService $4.buildMethod(LocalURLFetchService.java:95) I've tried this about half a dozen ways, starting with different -- address parameters thinking something wasn't picking up right on the default 0.0.0.0 argument and on 1.2.8 and 1.3 versions. The same code works fine if I publish to to production and run it there. My environment: -OSX -IntelliJ w/plugin -JDK1.6 Thanks! -Millisecond -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] One to many with JPA
I'd recommend reading this blog post - it contains everything you need to know to persist a one-to-many with JPA: http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html Max On Wed, Dec 16, 2009 at 2:21 PM, Richard richard.fa...@gmail.com wrote: Hi guys, I try to persist a one to many relationship but I get the following error (It's my first app): Caused by: java.lang.IllegalStateException: Field fr.beasymptotic.bookmark.client.model.BookmarkUser.bookmarks contains a persistable object that isnt persistent, but the field doesnt allow cascade-persist! What's wrong here : @Entity public class Bookmark implements Serializable { /** * */ private static final long serialVersionUID = -5148690849535943792L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Extension(vendorName=datanucleus, key=gae.encoded-pk, value=true) private String id; @Basic private String link; @Basic private String shortName; ... } @Entity public class BookmarkUser implements Serializable { /** * */ private static final long serialVersionUID = -4970721952298475845L; @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Basic private String userUIDFromGoogle; @Basic private ListBookmark bookmarks; ... } Thanks, Richard -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] TaskQueue and null host name
Where is your code that adds the task to the queue? Is it being run during server initializaiton, perhaps as part of a static block or a LoadOnStartup servlet? Thanks, Max On Tue, Dec 15, 2009 at 8:27 AM, Millisecond millisec...@gmail.com wrote: Hello, I'm just testing out super basic TaskQueue stuff in the dev environment and running into an exception I just can't seem to shake. Code: Queue queue = QueueFactory.getQueue(mail-queue); queue.add(url(/api/RunMonitor)); Exception: java.lang.IllegalArgumentException: Host name may not be null at org.apache.commons.httpclient.HttpHost.init(Unknown Source) at org.apache.commons.httpclient.HttpHost.init(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.setURI(Unknown Source) at org.apache.commons.httpclient.HttpMethodBase.init(Unknown Source) at org.apache.commons.httpclient.methods.ExpectContinueMethod.init (Unknown Source) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.init (Unknown Source) at org.apache.commons.httpclient.methods.PostMethod.init(Unknown Source) at com.google.appengine.api.urlfetch.dev.LocalURLFetchService $RedirectablePostMethod.init(LocalURLFetchService.java:348) at com.google.appengine.api.urlfetch.dev.LocalURLFetchService $4.buildMethod(LocalURLFetchService.java:95) I've tried this about half a dozen ways, starting with different -- address parameters thinking something wasn't picking up right on the default 0.0.0.0 argument and on 1.2.8 and 1.3 versions. The same code works fine if I publish to to production and run it there. My environment: -OSX -IntelliJ w/plugin -JDK1.6 Thanks! -Millisecond -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: Class XXX has multiple relationship fields of type YYYY
Datastore cursors is something we hoped to support in 1.2.8 but it didn't quite make it in. There are changes in the ORM code to support it but it's not actually enabled in the datastore back-end. This should be available early next year. On Sat, Dec 12, 2009 at 7:46 AM, David Fuelling sappe...@gmail.com wrote: Thanks Max, that fixed my problem with the inheritence. One other question: What version of the ORM code is currently included in the 1.2.8 SDK? I only ask because I noticed that the release notes for ORM VERSION 1.0.4 Final includes Support datastore cursors, and am wondering if that is actually working or still a pre-release item (didn't see anything in the docs about it). Thanks! david On Dec 10, 11:24 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: I've made a backwards-compatible bug fix release candidate available athttp://code.google.com/p/datanucleus-appengine/downloads/list The release contains a fix for this issue and also renames the config property to datanucleus.appengine.allowMultipleRelationsOfSameType Max -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
(HttpConnection.java:830) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:396) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) I've got to be missing something. :( thanks, -bryce On Fri, Dec 11, 2009 at 8:54 AM, bryce cottam bcot...@gmail.com wrote: Thanks a million Max, I've been on the road for a few days but I'm looking forward to trying this out when I get back. Thanks for the link Jonathan. -bryce On Dec 11, 2009 6:50 AM, Jonathan apos;J5apos; Cook jonathan.j5.c...@gmail.com wrote: Thanks for the fix, Max and perfect timing for me :) I just upgraded to 1.2.8 and started having this issue last night. For those who don't/didn't already know (like myself), here is a link to instructions Max wrote on how to install a new plugin version into the SDK: http://code.google.com/p/datanucleus-appengine/wiki/HowToUpdateTheSDKWithANewPluginVersion Regards, J5 On Dec 10, 11:59 am, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: I've posted a bug fix release candidate containing this fix here: http://datanucleus-appengine.googlecode.com/files/appengine-orm-1.0.4... On Tue, Dec 8, 2009 at 5:26 PM, bryce cottam bcot...@gmail.com wrote: That's great news Ma... On Dec 8, 2009 5:20 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com maxr%2bappeng...@google.com maxr%252bappeng...@google.com wrote:I've filed bug http://code.google.com/p/datanucleus-appengine/issues/detail?id=1... On Tue, Dec 8, 2009 at 11:29 AM, bryce cottam bcot...@gmail.com wrote: It's all goo... google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com google-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%252bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-j... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
Sure, sorry it was such a headache for you. When I've got a fix ready I'll let you know. On Mon, Dec 14, 2009 at 10:57 AM, bryce cottam bcot...@gmail.com wrote: good point, I kinda got lost in the exceptions I was getting :) I wound up sorting it out by making an embedded class instead of having multiple parent classes for a given child class. Although, it would be nice if a child class could have different parent types. Thanks for all your help Max. -bryce On Mon, Dec 14, 2009 at 11:30 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: I believe the exception you're getting is the result of having multiple parents for the same type, and unfortunately that bug isn't fixed in this release. The bugs fixed in this release are: - Incorrect exception for multiple fields of same type http://code.google.com/p/datanucleus-appengine/issues/detail?id=172 - Non-persistent base classes do not work http://code.google.com/p/datanucleus-appengine/issues/detail?id=169 - Relationships in abstract base classes don't work http://code.google.com/p/datanucleus-appengine/issues/detail?id=171 On Sat, Dec 12, 2009 at 1:09 AM, bryce cottam bcot...@gmail.com wrote: hmmm I think I may have installed the patch wrong perhaps. I still get the same error. I'm using the same code I sent you for the test case Max. Do you see any tell-tale signs in here that indicate I've mis-configured something? I have datanucleus-appengine-1.0.4.1-RC2.jar on my classpath and I removed the previous one (pretty much the same jar but with .final.jar as it's name. I followed the steps outlined by Jonathan. here is the stack trace: java.lang.ClassCastException: oid is not instanceof javax.jdo.identity.ObjectIdentity at com.resmark.model.RatePlan.jdoCopyKeyFieldsFromObjectId(RatePlan.java) at org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObjectAsValue(PersistenceCapableMapping.java:657) at org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObject(PersistenceCapableMapping.java:364) at org.datanucleus.store.appengine.DatastoreRelationFieldManager$1.setObjectViaMapping(DatastoreRelationFieldManager.java:128) at org.datanucleus.store.appengine.DatastoreRelationFieldManager$1.apply(DatastoreRelationFieldManager.java:104) at org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(DatastoreRelationFieldManager.java:78) at org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(DatastoreFieldManager.java:812) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(DatastorePersistenceHandler.java:288) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:241) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(DatastorePersistenceHandler.java:225) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent(JDOStateManagerImpl.java:3161) at org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java:1298) at org.datanucleus.ObjectManagerImpl.persistObject(ObjectManagerImpl.java:1175) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent(JDOPersistenceManager.java:669) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent(JDOPersistenceManager.java:694) at com.resmark.JdoTestServlet.create(JdoTestServlet.java:183) at com.resmark.JdoTestServlet.doTest(JdoTestServlet.java:90) at com.resmark.JdoTestServlet.doGet(JdoTestServlet.java:33) 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.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084) at com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:121) 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
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
JPA _only_ supports list-ordering (the good kind). You can use the @OrderBy annotation to specify the properties to order by, but even if you leave this annotation off it will order by the primary key field. On Mon, Dec 14, 2009 at 8:45 PM, Todd Vierling t...@duh.org wrote: On Dec 14, 11:06 pm, Max Ross (Google) maxr+appeng...@google.commaxr%2bappeng...@google.com wrote: Ok I've got good news for you. I need to do more testing but I think different parent types for child objects should work fine as long as you use list-ordering for your one-to-many relationships, which you really ought to be doing anyway. Position properties are already incredibly inefficient, and it turns out the bug you're running into only applies when there are position properties in play. You can read more about it in this section: http://code.google.com/appengine/docs/java/datastore/relationships.ht... Ordered Collections Maintain Their Order). So, if you change your one-to-many relationship on RatePlan to: @Persistent @Order(extensions = @Extension(vendorName=datanucleus, key=list-ordering, value=id)) Does this affect JPA modeling as well, and if so, how does the above map to JPA annotations? (I assume the value is the key field, so if using Key, it should work too?) -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
If you order by anything other than your primary key you'll take a performance and cpu hit on writes but there won't be a penalty on your reads. The reason the JDO default is such a problem is that it adds an implicit property to each child entity containing the position of that entity in its parent's list. If you ever remove or add an element in this list at a location that isn't the end, everything between that element and the end of the list needs to get shifted down. In an RDBMS you'd just issue an update statement to increment everything by 1 relative to its current value, but the datastore doesn't support this type of relative update, so ends up doing one write per entity whose index needs shifting. So in short, don't do it this way. :-) Max On Mon, Dec 14, 2009 at 9:42 PM, bryce cottam bcot...@gmail.com wrote: hahaha, no that doesn't sound draconian. I remember reading that the ordering of lists can be a performance hit, I haven't bothered to look too deep into it yet (since I'm only doing a proof of concept right now). I have some questions about it though. For instance, what if I were to order by some kind of displayOrder field that I maintain? Would that also suffer a performance lag? I mainly want to move to the GAE for performance and scalability, so I think I'd appreciate a runtime/compile time warning that told me about things I was doing that would hurt my performance. Thanks again for helping me out so much. -bryce On Mon, Dec 14, 2009 at 9:06 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Ok I've got good news for you. I need to do more testing but I think different parent types for child objects should work fine as long as you use list-ordering for your one-to-many relationships, which you really ought to be doing anyway. Position properties are already incredibly inefficient, and it turns out the bug you're running into only applies when there are position properties in play. You can read more about it in this section: http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_Many_Relationships (How Ordered Collections Maintain Their Order). So, if you change your one-to-many relationship on RatePlan to: @Persistent @Order(extensions = @Extension(vendorName=datanucleus, key=list-ordering, value=id)) private ListRatePlan ratePlans = new ArrayListRatePlan(); you should be in business. Position properties are so bad I'm considering turning them into a meta-data error that you have to explicitly silence with a jvm property. What do you think, too draconian? Max On Mon, Dec 14, 2009 at 11:09 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Sure, sorry it was such a headache for you. When I've got a fix ready I'll let you know. On Mon, Dec 14, 2009 at 10:57 AM, bryce cottam bcot...@gmail.com wrote: good point, I kinda got lost in the exceptions I was getting :) I wound up sorting it out by making an embedded class instead of having multiple parent classes for a given child class. Although, it would be nice if a child class could have different parent types. Thanks for all your help Max. -bryce On Mon, Dec 14, 2009 at 11:30 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: I believe the exception you're getting is the result of having multiple parents for the same type, and unfortunately that bug isn't fixed in this release. The bugs fixed in this release are: - Incorrect exception for multiple fields of same type http://code.google.com/p/datanucleus-appengine/issues/detail?id=172 - Non-persistent base classes do not work http://code.google.com/p/datanucleus-appengine/issues/detail?id=169 - Relationships in abstract base classes don't work http://code.google.com/p/datanucleus-appengine/issues/detail?id=171 On Sat, Dec 12, 2009 at 1:09 AM, bryce cottam bcot...@gmail.com wrote: hmmm I think I may have installed the patch wrong perhaps. I still get the same error. I'm using the same code I sent you for the test case Max. Do you see any tell-tale signs in here that indicate I've mis-configured something? I have datanucleus-appengine-1.0.4.1-RC2.jar on my classpath and I removed the previous one (pretty much the same jar but with .final.jar as it's name. I followed the steps outlined by Jonathan. here is the stack trace: java.lang.ClassCastException: oid is not instanceof javax.jdo.identity.ObjectIdentity at com.resmark.model.RatePlan.jdoCopyKeyFieldsFromObjectId(RatePlan.java) at org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObjectAsValue(PersistenceCapableMapping.java:657) at org.datanucleus.store.mapped.mapping.PersistenceCapableMapping.setObject
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
A Set will not suffer from this same problem. The datastore has no way of knowing what the sort function of your SortedSet might be so this will be treated as an unordered Collection as well, but the sort will happen in-memory as the collection is populated. If the collection has an explicit ordering then the JDO default is probably what you want since it does all the shifting that you'd need to implement yourself, but there is this bug you've run into, and I suspect there are others. If you don't want the overhead of a datastore index on displayOrder and you know you're not going to have too many child objects, doing the sort in-memory may be fine. Don't optimize too early though. I'd see what the performance of writes look like with the datastore index and then go from there. Max On Mon, Dec 14, 2009 at 10:10 PM, bryce cottam bcot...@gmail.com wrote: do SortedSets suffer from the same problem? In particular, I could define a displayOrder property that was rather sparse (every 10th int or something: 10, 20, 30 etc.) and if I needed to insert something between the first and second (which shouldn't happen very often) I could just set it's displayOrder to 15 and throw it in the set. The only reason I bring it up, is because our app allows users to order certain types of data (really just one type), but frankly, they don't move them around much at all, it's pretty much defined at creation time, but *sometimes* they alter that ordering. I don't anticipate this being a huge problem, heck I could sort the set after it gets out of the datastore if I had to using a displayOrder field or something. I don't want to bog down my performance doing this through some implicit index. thanks, -bryce On Mon, Dec 14, 2009 at 11:04 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: If you order by anything other than your primary key you'll take a performance and cpu hit on writes but there won't be a penalty on your reads. The reason the JDO default is such a problem is that it adds an implicit property to each child entity containing the position of that entity in its parent's list. If you ever remove or add an element in this list at a location that isn't the end, everything between that element and the end of the list needs to get shifted down. In an RDBMS you'd just issue an update statement to increment everything by 1 relative to its current value, but the datastore doesn't support this type of relative update, so ends up doing one write per entity whose index needs shifting. So in short, don't do it this way. :-) Max On Mon, Dec 14, 2009 at 9:42 PM, bryce cottam bcot...@gmail.com wrote: hahaha, no that doesn't sound draconian. I remember reading that the ordering of lists can be a performance hit, I haven't bothered to look too deep into it yet (since I'm only doing a proof of concept right now). I have some questions about it though. For instance, what if I were to order by some kind of displayOrder field that I maintain? Would that also suffer a performance lag? I mainly want to move to the GAE for performance and scalability, so I think I'd appreciate a runtime/compile time warning that told me about things I was doing that would hurt my performance. Thanks again for helping me out so much. -bryce On Mon, Dec 14, 2009 at 9:06 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Ok I've got good news for you. I need to do more testing but I think different parent types for child objects should work fine as long as you use list-ordering for your one-to-many relationships, which you really ought to be doing anyway. Position properties are already incredibly inefficient, and it turns out the bug you're running into only applies when there are position properties in play. You can read more about it in this section: http://code.google.com/appengine/docs/java/datastore/relationships.html#Owned_One_to_Many_Relationships (How Ordered Collections Maintain Their Order). So, if you change your one-to-many relationship on RatePlan to: @Persistent @Order(extensions = @Extension(vendorName=datanucleus, key=list-ordering, value=id)) private ListRatePlan ratePlans = new ArrayListRatePlan(); you should be in business. Position properties are so bad I'm considering turning them into a meta-data error that you have to explicitly silence with a jvm property. What do you think, too draconian? Max On Mon, Dec 14, 2009 at 11:09 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Sure, sorry it was such a headache for you. When I've got a fix ready I'll let you know. On Mon, Dec 14, 2009 at 10:57 AM, bryce cottam bcot...@gmail.com wrote: good point, I kinda got lost in the exceptions I
Re: [appengine-java] Re: problems with SDK 1.2.8 and (local) task queues timing out...
Please re-read the thread leading up to your post. The timeout shouldn't impact the completion of the request on the server. If you're seeing something different please let me know. Thanks, Max On Thu, Dec 10, 2009 at 10:26 PM, Heyali heyal...@gmail.com wrote: I am also facing simmilar problem. Any clue? -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Local Task queues not rate limited in 1.2.8
Hi Sam, Please read this section of the docs: http://code.google.com/appengine/docs/java/taskqueue/overview.html#Task_Queues_and_the_Development_Server It describes the differences between production task queues and local task queus and explains how to switch back to the old method of manually triggering tasks. Thanks, Max On Fri, Dec 11, 2009 at 4:02 AM, Sam Hasler sam.has...@gmail.com wrote: Local Task Queue are running tasks as fast as they can an not honouring the maximum rate for the queue. on a 0.5/s queue I'm seeing 80+ tasks handled in a matter of seconds. This is a problem for me because I am using the URLFetch service to fetch content that I am not supposed to request more than once every 2 seconds. I'd like to at least see the local queues honouring the maximum rate, but it would be really useful to be able to pause the queues and have the old method of manually triggering tasks in the queue to be processed. Sometimes I just want to test that I'm queuing stuff up correctly and don't necessarily want the tasks to run. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Inherit one-to-many relationship
Found and fixed the issue: http://code.google.com/p/datanucleus-appengine/issues/detail?id=171 On Wed, Dec 9, 2009 at 11:48 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Could you please post all the model objects that are involved in the example? Looks like SpeciesStats is missing. Also, it would be great if you could post the code that shows how you populate the Community object before persisting. Thanks, Max On Wed, Dec 9, 2009 at 11:40 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Thanks for the report, investigating now On Tue, Dec 8, 2009 at 2:33 PM, Pierre Lavignotte pierre.lavigno...@gmail.com wrote: Hi, I have a problem when I try to inherit a one-to-many relation ship from a base entity class. The following model works fine : @PersistenceCapable(identityType = IdentityType.APPLICATION) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class BaseEntity { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; public Key getKey() { return key; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Community extends BaseEntity { @Persistent @Element(dependent = true) private ListSpeciesStats stats = new ArrayListSpeciesStats(); public ListSpeciesStats getStats() { return stats; } @Persistent(dependent = true) TackleBox tackleBox; public TackleBox getTackleBox() { return tackleBox; } public void setTackleBox(TackleBox tackleBox) { this.tackleBox = tackleBox; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class TackleBox extends BaseEntity { /* some other properties that eventually extend BaseEntity and so on */ } But if I move private ListSpeciesStats stats from Community to BaseEntity, I get a runtime exception when trying to read a Community entity : Caused by: java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute (DatastoreQuery.java:212) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute (JDOQLQuery.java:85) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) Or trying to persist one : java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:1008) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:998) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:133) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java
Re: [appengine-java] Inherit one-to-many relationship
I've posted a bug fix release candidate containing this fix here: http://datanucleus-appengine.googlecode.com/files/appengine-orm-1.0.4.1.RC1.zip On Thu, Dec 10, 2009 at 11:51 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Found and fixed the issue: http://code.google.com/p/datanucleus-appengine/issues/detail?id=171 On Wed, Dec 9, 2009 at 11:48 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Could you please post all the model objects that are involved in the example? Looks like SpeciesStats is missing. Also, it would be great if you could post the code that shows how you populate the Community object before persisting. Thanks, Max On Wed, Dec 9, 2009 at 11:40 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Thanks for the report, investigating now On Tue, Dec 8, 2009 at 2:33 PM, Pierre Lavignotte pierre.lavigno...@gmail.com wrote: Hi, I have a problem when I try to inherit a one-to-many relation ship from a base entity class. The following model works fine : @PersistenceCapable(identityType = IdentityType.APPLICATION) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class BaseEntity { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; public Key getKey() { return key; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Community extends BaseEntity { @Persistent @Element(dependent = true) private ListSpeciesStats stats = new ArrayListSpeciesStats(); public ListSpeciesStats getStats() { return stats; } @Persistent(dependent = true) TackleBox tackleBox; public TackleBox getTackleBox() { return tackleBox; } public void setTackleBox(TackleBox tackleBox) { this.tackleBox = tackleBox; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class TackleBox extends BaseEntity { /* some other properties that eventually extend BaseEntity and so on */ } But if I move private ListSpeciesStats stats from Community to BaseEntity, I get a runtime exception when trying to read a Community entity : Caused by: java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute (DatastoreQuery.java:212) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute (JDOQLQuery.java:85) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) Or trying to persist one : java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:1008
Re: [appengine-java] Re: Class XXX has multiple relationship fields of type YYYY
I've made a backwards-compatible bug fix release candidate available at http://code.google.com/p/datanucleus-appengine/downloads/list The release contains a fix for this issue and also renames the config property to datanucleus.appengine.allowMultipleRelationsOfSameType Max On Thu, Dec 10, 2009 at 9:55 AM, David Fuelling sappe...@gmail.com wrote: Hmm...looks like I'm not using @MappedSuperclass in my abstract parent class. I'll give that a try and see if it fixes things. On Dec 9, 8:27 pm, David Fuelling sappe...@gmail.com wrote: Thanks Max! Just updated to 1.2.8 and ran into this problem. The workaround looks good, though I think you specified the boolean value wrong if you want to disable this error. Should be: property name=datanucleus.appengine.multipleRelationsOfSameTypeAreErrors value=false/ In my case, the app builds fine with no Enhancer errors or warnings. However, when I run my app, I'm get the following error when I try to load entities that extend an abstract baseclass: javax.persistence.PersistenceException: PersistentclassXXXdoes not seem to have been enhanced. XXX is an abstractclasssimilar to your Bclassabove. Any ideas? My abstractclassis not marked as an Entity. -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: oid is not instanceof javax.jdo.identity.ObjectIdentity
where I can present my proof of concept to the higher ups and then start dedicating time to simply porting our app to the app-engine, but this may make me step back a bit. Our classes share a lot of data, usually I can get around this with the XyzFK pattern used above (i.e. ActivityFK and ActivityLaunchFK), but those are just foreign keys with denormalized data that allows for either querying filters, or simple field loading of foreign objects without loading the full foreign object. I thought that the layout of BigTable just made rows of child/dependant objects sequentially after the parent row: Activity(275) {name:Foo Bar, fieldN:valueN...} Activity(275)/RatePlan(123) {name:foo bar Rate, . fieldN:valueN...} Activity(276) {name:Bar Baz, fieldN:valueN...} Activity(276)/RatePlan(124) {name:bar baz Rate, . fieldN:valueN...} . and that you'd be able to do something like: Bundle(543) {name:Foo Bar Bundle, fieldN:valueN...} Bundle(543)/RatePlan(321) {name:my Rate, . fieldN:valueN...} You can make RatePlan instances without a parent right? I thought I had a handle on the BigTable layout, but perhaps I am wrong? It would be really great for me if a particular class could be a field on more than one parent containing class, *not the same instance*, but just the same type. Is there any other way (besides just using Key instances) you can think of that would accomplish what I am after? thanks again, -bryce On Tue, Dec 8, 2009 at 7:21 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Filed http://code.google.com/p/datanucleus-appengine/issues/detail?id=170 On Tue, Dec 8, 2009 at 6:18 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Ok I think I know what's going on. First here's a stripped down version of your object model with the bare minimum needed to reproduce the exception: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class RatePlan { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Activity { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private ListRatePlan ratePlans = new ArrayListRatePlan(); } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Bundle { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private RatePlan ratePlan; public void setRatePlan(RatePlan ratePlan) { this.ratePlan = ratePlan; } } And here's the unit test I turned your code into that generates the exception: public void testBryce() { pm.newQuery(Activity.class).execute(); Bundle bundle = new Bundle(); bundle.setRatePlan(new RatePlan()); pm.makePersistent(bundle); } I believe the issue is that RatePlan is owned by two different objects in your model - Bundle and Activity. Due to the nature of primary keys in the app engine datastore, a class can only have a single owner. We detect other flavors of this scenario when the entity meta-data is loaded but not this particular variant. I'll file a bug and try to produce a useful exception. To work around this you'll need to either switch Activity.ratePlans or Bundle.ratePlans to be an unowned relationship and just store the Key of the RatePlan rather than the RatePlan itself. Please give that a try and let me know how it goes. Thanks, Max On Tue, Dec 8, 2009 at 10:19 AM, bryce cottam bcot...@gmail.com wrote: No worries Max, I'm using 1.2.6 right now, so the multiple instance bug isn't an issue right now. Whenever you get to it is fine. As always I appreciate your input. Thanks -bryce On Dec 8, 2009 10:14 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Hi Bryce, I started digging into you issue and quickly bumped into the Multiple relationships of the same type bug for which I posted the workaround. Then I got bogged down with unrelated stuff. I have definite plans to get back to your example today. Thanks for being patient, and sorry this is taking so long. Max On Mon, Dec 7, 2009 at 11:35 PM, bcottam bcot...@gmail.com wrote: Max, have you had a chance... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group
Re: [appengine-java] Inherit one-to-many relationship
Thanks for the report, investigating now On Tue, Dec 8, 2009 at 2:33 PM, Pierre Lavignotte pierre.lavigno...@gmail.com wrote: Hi, I have a problem when I try to inherit a one-to-many relation ship from a base entity class. The following model works fine : @PersistenceCapable(identityType = IdentityType.APPLICATION) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class BaseEntity { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; public Key getKey() { return key; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Community extends BaseEntity { @Persistent @Element(dependent = true) private ListSpeciesStats stats = new ArrayListSpeciesStats(); public ListSpeciesStats getStats() { return stats; } @Persistent(dependent = true) TackleBox tackleBox; public TackleBox getTackleBox() { return tackleBox; } public void setTackleBox(TackleBox tackleBox) { this.tackleBox = tackleBox; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class TackleBox extends BaseEntity { /* some other properties that eventually extend BaseEntity and so on */ } But if I move private ListSpeciesStats stats from Community to BaseEntity, I get a runtime exception when trying to read a Community entity : Caused by: java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute (DatastoreQuery.java:212) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute (JDOQLQuery.java:85) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) Or trying to persist one : java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:1008) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:998) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:133) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess (DatastorePersistenceHandler.java:316) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects (DatastorePersistenceHandler.java:236) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject (DatastorePersistenceHandler.java:225) at org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent (JDOStateManagerImpl.java:3185) at org.datanucleus.state.JDOStateManagerImpl.makePersistent
Re: [appengine-java] Inherit one-to-many relationship
Could you please post all the model objects that are involved in the example? Looks like SpeciesStats is missing. Also, it would be great if you could post the code that shows how you populate the Community object before persisting. Thanks, Max On Wed, Dec 9, 2009 at 11:40 AM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Thanks for the report, investigating now On Tue, Dec 8, 2009 at 2:33 PM, Pierre Lavignotte pierre.lavigno...@gmail.com wrote: Hi, I have a problem when I try to inherit a one-to-many relation ship from a base entity class. The following model works fine : @PersistenceCapable(identityType = IdentityType.APPLICATION) @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE) public abstract class BaseEntity { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; public Key getKey() { return key; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Community extends BaseEntity { @Persistent @Element(dependent = true) private ListSpeciesStats stats = new ArrayListSpeciesStats(); public ListSpeciesStats getStats() { return stats; } @Persistent(dependent = true) TackleBox tackleBox; public TackleBox getTackleBox() { return tackleBox; } public void setTackleBox(TackleBox tackleBox) { this.tackleBox = tackleBox; } } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class TackleBox extends BaseEntity { /* some other properties that eventually extend BaseEntity and so on */ } But if I move private ListSpeciesStats stats from Community to BaseEntity, I get a runtime exception when trying to read a Community entity : Caused by: java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute (DatastoreQuery.java:212) at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute (JDOQLQuery.java:85) at org.datanucleus.store.query.Query.executeQuery(Query.java:1489) at org.datanucleus.store.query.Query.executeWithArray(Query.java: 1371) at org.datanucleus.store.query.Query.execute(Query.java:1344) at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:221) Or trying to persist one : java.lang.NullPointerException at org.datanucleus.store.appengine.DatastoreTable.runCallBacks (DatastoreTable.java:1025) at org.datanucleus.store.appengine.DatastoreTable.initializeNonPK (DatastoreTable.java:391) at org.datanucleus.store.appengine.DatastoreTable.buildMapping (DatastoreTable.java:285) at org.datanucleus.store.appengine.DatastoreManager.buildStoreData (DatastoreManager.java:405) at org.datanucleus.store.appengine.DatastoreManager.newStoreData (DatastoreManager.java:363) at org.datanucleus.store.AbstractStoreManager.addClasses (AbstractStoreManager.java:788) at org.datanucleus.store.AbstractStoreManager.addClass (AbstractStoreManager.java:759) at org.datanucleus.store.mapped.MappedStoreManager.getDatastoreClass (MappedStoreManager.java:358) at org.datanucleus.store.appengine.DatastoreManager.getDatastoreClass (DatastoreManager.java:631) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:1008) at org.datanucleus.store.appengine.DatastoreFieldManager.buildMappingConsumer (DatastoreFieldManager.java:998) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:133) at org.datanucleus.store.appengine.DatastoreFieldManager.init (DatastoreFieldManager.java:167) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess (DatastorePersistenceHandler.java:316) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
Re: [appengine-java] Re: oid is not instanceof javax.jdo.identity.ObjectIdentity
Hi Bryce, I started digging into you issue and quickly bumped into the Multiple relationships of the same type bug for which I posted the workaround. Then I got bogged down with unrelated stuff. I have definite plans to get back to your example today. Thanks for being patient, and sorry this is taking so long. Max On Mon, Dec 7, 2009 at 11:35 PM, bcottam bcot...@gmail.com wrote: Max, have you had a chance to try this out? I'm not trying to push or anything, just wanted to make sure my last message didn't get overlooked. I've noticed this error sort of... randomly popping up in places where it preivously hasn't as of late. If i'm missing something in my configuration, I'll be happy to change it, I'm just not sure what I'm missing. again, I really appreciate your taking the time to help me debug this issue. thanks, -bryce On Dec 3, 4:46 pm, bryce cottam bcot...@gmail.com wrote: Okay, sorry for the delay, I haven't been able to focus on this for a few days. here is the full (including the jar libararies in case there is an issue with them). http://www.resmarksystems.com/code/JdoTest.zip It's a very simple Servlet, by hitting the url hostname/jdotest you should execute the test case that is failing for me. I really appreciate your taking a look at this. I'm looking forward to getting it working. -bryce On Tue, Dec 1, 2009 at 10:15 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Just give me the smallest amount of compilable, runnable code that demonstrates the incorrect behavior. A unit test is preferable because I can just drop it into my own test framework and run it, but I'll take whatever format you can manage. Thanks, Max On Tue, Dec 1, 2009 at 1:18 PM, bryce cottam bcot...@gmail.com wrote: yeah, I didn't see a TransactionNotActiveException. here is my jdoconfig.xml: persistence-manager-factory name=transactions-optional property name=javax.jdo.PersistenceManagerFactoryClass value=org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory/ property name=javax.jdo.option.ConnectionURL value=appengine/ property name=javax.jdo.option.NontransactionalRead value=true/ property name=javax.jdo.option.NontransactionalWrite value=true/ property name=javax.jdo.option.RetainValues value=true/ property name=datanucleus.appengine.autoCreateDatastoreTxns value=true/ /persistence-manager-factory I think the only thing I changed was putting in this line: property name=datanucleus.appengine.autoCreateDatastoreTxns value=true/ which may explain why I don't get the TransactionNotActiveException. So, for this unit test/servlet, you want me to just post the class file here, or strip down all my code and put up all my model classes and the test case/servlet code somewhere in a war or something? h I just commented out that line, and I still get the same behavior (i.e. I don't get the TransactionNotActiveException). Not sure what's going on. thanks, -bryce On Tue, Dec 1, 2009 at 2:04 PM, Max Ross (Google) maxr+appeng...@google.com maxr%2bappeng...@google.com wrote: Now I'm starting to suspect something funny going on with your config. I received a TransactionNotActiveException when I tried to run your code without starting the txn, and the fact that you didn't receive that exception doesn't make any sense to me. I can't explain why you see the exception and I don't. The best thing would be for you to put together a stripped down test case that demonstrates the problem. An actual unit test would be ideal, but if you're not a position to write one then just a simple standalone servlet should suffice. Thanks, Max On Tue, Dec 1, 2009 at 1:00 PM, bryce cottam bcot...@gmail.com wrote: that is both a type-o and it was missing :) It was missing from my test code, but it was present in my real code. So, after putting the tx.begin() in the test code, I get the exact same behavior as the real code (i.e. nothing gets written to the datastore and I get the exception. Sorry about missing that in the code I posted. I'm kinda lost on where to go with this and where to look. I did notice that the code actually prompts the exception is in the datanucleus core and there is a comment above it that says: / TODO Factor out this PersistenceCapable reference ((PersistenceCapable)value).jdoCopyKeyFieldsFromObjectId(new AppIDObjectIdFieldConsumer(param, om, ps, javaTypeMappings), id); so, I'm not sure if this has soemthing to do with code style datanucleus is trying to phase out or what? Again, I'm not gonna be shocked if I'm missing something though. thanks! -bryce On Tue, Dec 1, 2009 at 1:53 PM
Re: [appengine-java] Re: database transaction problem
Hi Len, attempted to deregister a transaction that is not currently registered is an error thrown by the datastore api when a call is made to commit a txn and there is no txn to commit. Is it possible you have some path through your code that would result in calling commit() more than once or calling commit() after a rollback()? I can't explain the partial data you're seeing - transactional writes are atomic from your app down to the datastore down to the storage layer that the datastore is built on. Since you had 2 cron jobs executing concurrently is it possible that the writes interacted with one another in some previously unforeseen way? Max On Tue, Dec 8, 2009 at 1:14 AM, lent lentakeu...@gmail.com wrote: I took a look at the log entries more closely and it looks like the cron job which is to run daily got kicked off twice for some reason. Instead of one chain of 500 sequential tasks being started up two chains of 500 were running in parallel. This may explain the errors I was getting though I don't understand how there seems to have been a partial update. Len On Dec 8, 12:35 am, lent lentakeu...@gmail.com wrote: Hello, I have a daily cron job which kicks off a sequential 500 tasks (chained). These usually run successfuly but a few days ago, on the first task, I got the following error: [xxx/1.338222621935386721].stderr: java.lang.IllegalStateException: Attempted to deregister a transaction that is not currently registered. On the next task, I got the error again: [xxx/1.338222621935386721].stderr: java.lang.IllegalStateException: Attempted to deregister a transaction that is not currently registered. Then on the remaining 498 tasks I got the error: com.jostleme.jostle.ui.web.controller.DriverController processRefreshContributorTagsTask: failure while updating refresh tags info. Cause: Transaction rolled back due to failure during commit; nested exception is javax.persistence.PersistenceException: Transaction rolled back due to failure during commit After this data seems to have gotten corrupted. By this I mean that something that should have run in a transaction (all or nothing) seems to have done a partial update. Does anyone (especially google folks) have any insights on this behavior? Regards, Len -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.
Re: [appengine-java] Re: new in 1.2.8: relationship fields of type parent class that isn't even persisted. This is not yet supported.
I've filed bug http://code.google.com/p/datanucleus-appengine/issues/detail?id=169 to track the problem with non-persistent base classes. I have a fix in the works. I'll be posting a release candidate with this fix and hopefully a few others in the next day or two. Thanks, Max On Tue, Dec 8, 2009 at 11:29 AM, bryce cottam bcot...@gmail.com wrote: It's all good, we're just trying to get to the bottom of the issue. I'm sure the use of the word enhancer was just contextual. You have indeed demonstrated that datanucleus isn't complaining. We're all friends here :) thanks for helping us narrow the the root cause of the problem down. Thanks, -bryce On Dec 8, 2009 11:18 AM, datanucleus andy_jeffer...@yahoo.com wrote: 1) why the enhancer complains that BaseObject need to be enhanced even though it does not declar... There is no problem presented here with the enhancer complaining. All is at runtime actually, thrown from a call by GAE/J's DN plugin, as shown by the stack trace above. As I've already stated, DataNucleus does NOT require any base class to be persistent when the classes are declared as I've already shown. If you have some other situation then demonstrate it -- You received this message because you are subscribed to the Google Groups Google App Engine fo... -- 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-j...@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com . For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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-j...@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.