[appengine-java] Re: Turning off logging for spring security when running in App Engine java
What logging API does Spring use? I'm wondering if you just need to update your logging.properties with: .level=WARNING Or whatever is appropriate. You have to use Java logging to fine tune logging. More here http://code.google.com/appengine/docs/java/runtime.html#Logging. -- 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/-/bo8vgWggHsUJ. 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: When will https support will be available for custom domains?
There are some other threads that touch on this, both in this group and the Google App Engine group. You might find more info by searching here and there. -- 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/-/iP_erzyYhsoJ. 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: Learning JDO for AppEngine
Are you wanting to learn JDO because you're interested in JDO in particular, or are you wanting to learn it just for GAE? If the latter, I'm wondering if you might be interested in other APIs that might be a bit better suited for GAE. -- 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/-/gVTy_Q4uVPwJ. 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] My Project: Forum Hosting
My project is a forum hosting service. I have it up in demo mode at: http://support.fuzedtest.appspot.com/ The demo is limited by the free quota, but you can still create and manage your own forum, register for a forum, etc. This won't be the final location: it will be abandoned once the project officially goes live. But right now I'm wondering how efficient it will be (and conversely how expen$ive it will be). I spent some significant time trying to optimize datastore interactions and wonder if it was time well spent (that is, I wonder if I did a good job). Some of the discussions on cost have me worried that it'll just cost too much to run. Hope not. And in any case, there's more I can do with caching, etc. It went through several phases, including changing from JDO to Objectify, Spring to Guice, integrating Apache Shiro, Master/Slave to HRD, leveraging GWT, working within the limitations of the GAE SSL support ... hope the new SSL support is released soon. With all of that and many other unexpected issues, I think I spend quite a bit more time on infrastructure than on features. Hopefully that trend will reverse. I'm sure I'll have to fix and enhance the infrastructure part, but I'd rather spend more time adding features people like. Anyway, stop by and bang on it if you feel like it. It'll be interesting to see if and when it blows the quota. :) -- 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/-/G1uS5KofZ0gJ. 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] My Project: Forum Hosting
I think I'm used to strong passwords. I should probably loosen that up a bit. :) Thanks for the feedback. I used Shiro because it's pretty well documented and flexible. Spring has Spring Security, but there's no default equivalent for Guice. Also Shiro seems more comprehensive than Spring Security and I was able to get it to work in GAE without too much trouble. On the SSL issue, wild card certs only work one level deep. The url support.fuzedtest.appspot.com is two levels and so you get the SSL issue. If you got there from the Sign In link, you should have gotten something more like this: https://fuzedtest.appspot.com/signin.html?context=support I wonder why you didn't ... Anyway, that's why I'm looking forward to the SSL support that Google is working on now. Thanks for checking it out! -- 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/-/G0C0Y6WUO90J. 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: Spring AOP behaving inconsistently on Google infrastructure.
That's pretty crazy. Do you know what you're using for AOP? I'm using Guice, which using AOP alliance stuff, and it works consistently. Does Spring use AspectJ? -- 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/-/W9ZS-koHruAJ. 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: Spring AOP behaving inconsistently on Google infrastructure.
Can you make it only use the AOP alliance libs? I am totally guessing, so maybe that's pointless. -- 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/-/0HTXDjJLV0wJ. 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] Does the SDK in WEB-INF/lib Get Deployed?
I decided to give Objectify a try because I think any significant reduction in startup time could be quite valuable. It appears my startup time is now around 8s. So maybe 2s less, but I don't have any objective data. It's certainly not around 2s total. Alas. On the plus side, Objectify seems better than JDO for me. If nothing else, it maps embedded objects in a much more natural way and I don't have the JDO post processing times. So it was probably worth it to me to switch to Objectify, but a reduction from 10s to 2s is not really in the cards. -- 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/-/cY1UM7iYR24J. 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] Does the SDK in WEB-INF/lib Get Deployed?
I'm wondering if JARs like appengine-api-1.0-sdk-1.5.2.jar in WEB-INF/lib get uploaded when I deploy from Eclipse. Are these items needed in the Google environment? I'm asking because I'm wondering if removing (if viable) would reduce my startup time, which seems to come in anywhere from 10s to 20s. Thanks. -- 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/-/2TbrcIZmZ4oJ. 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] Does the SDK in WEB-INF/lib Get Deployed?
I'm just generally trying to look to see if there's anything I can trim. My app seems to need to spin up a new instance a lot (the instance seems to stay up for only a minute or so if I'm not using it), and so there are a lot of 10s delays for requests. I don't really have a ton of libraries, though. :-/ But maybe it's more than average, since I don't know what average is. Thanks for the information though. I won't worry about the SDK then. -- 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/-/RqAeKYjd-BAJ. 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] Does the SDK in WEB-INF/lib Get Deployed?
I do use JDO (not JPA) and Guice (and not Spring). I also use GWT, GIN and Shiro. So I have maybe 5 primary libraries, along with the SDK. -- 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/-/MxRdX5ALQmEJ. 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] Eclipse GAE with OSX Lion
I've not had any problems with Lion either. Working fine. -- 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/-/lIAdDf8NweQJ. 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: secure appengine urls with security constraints
To require https, you can do this: security-constraint web-resource-collection url-pattern/mobile/*/url-pattern /web-resource-collection user-data-constraint transport-guaranteeCONFIDENTIAL/transport-guarantee /user-data-constraint /security-constraint -- 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/-/CE1hDzrCcUcJ. 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] GWT + GAE Deployment
What settings are those? -- 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/-/1m7bPo0q3ysJ. 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: HashMap within an Embedded Class
I think this is pretty much busted. Within top-level entity, it's fine. In and embedded entity, I get the error in the OP. -- 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/-/pIyyUhBvS3gJ. 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: HashMap within an Embedded Class
I'm still trying to figure it out, but I appear to have the same problem. -- 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/-/th0atdR-LKEJ. 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] Apache Shiro on Google App Engine
As far as I know, there's nothing that prevents the conditionals throughout the code. Fortunately, with GWT, you're basically coding in Java, so all of the patterns you're used to for reducing the number of conditionals in your code should apply in the same way (basically, polymorphism through factories, etc.). -- 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/-/t66wciLWpgIJ. 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] Apache Shiro on Google App Engine
Well, on the client (browser), there's no security at all. Security (that is, protecting your site from the user), is impossible. If you just mean disabling buttons or changing parts of the page, then you can just pass back permissions to do that. It doesn't guarantee anything, of course. If you mean on the server, GWT requests are web requests. So you intercept them with the filter (shown in my post). If you mean something else, let me know. -- 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/-/U6-P-0mm1HkJ. 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] Apache Shiro on Google App Engine
If anyone is interested, I've posted a short guide to using Apache Shiro on Google App Engine: http://objectuser.wordpress.com/2011/06/30/apache-shiro-on-google-app-engine/ It focuses on my current stack, which includes Google Guice. I also use GWT, but that should mostly be irrelevant. -- 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/-/Y2s1I4sg07AJ. 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: how to add a child without the collection
You're right. I confused the two: I said unowned while actually describing inverting the relationship. Do I get half a point? ;) -- 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/-/TCzZ-0Xd5sIJ. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: JDO: how to add a child without the collection
For something large like that, I think you'll want to make your relationship from User to LoginHistory an unowned relationship. That simply means that LoginHistory will store an ID that points to User instead of User having a collection of LoginHistory objects. The Google docs have more on that herehttp://code.google.com/appengine/docs/java/datastore/jdo/relationships.html. I have blogged a bit about relationship models, the most relevant being this onehttp://objectuser.wordpress.com/2009/05/31/queries-in-gae-one-to-many/, which you might find helpful (defer to Google's docs over mine, of course). -- 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/-/F4XUC978UdsJ. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: JDO: 1-N relationships
As long as both the user and tracks are in the same entity group, you can do just that. Whether that's a good idea or not depends on how those users and tracks will be used. If only one user is going to be messing with the tracks, then you should be fine. If many users need to update those tracks, then you will have a lot of contention on that entity group. This is all because only one transaction can update an entity group at a time. On Jun 24, 2:47 am, Martin Newstead skankmar...@hotmail.com wrote: I would like some help and advice on how to model my entities using JDO on GAE. My problem is this, I have a bunch of Users and each User may create zero or more Tracks. Users may exist without a Track but Tracks may not exist without a User who created them. Other attributes on the User and the Track may updated. I would like to be able to query the Tracks and retrieve some attributes from the User who created the Track. The attributes from the User may get updated. In SQL this would be select u.displayName, t.trackName from User u, Track t, where t.userId=u.userId I have some ideas and have tried various things but this isn't a post on why doesn't something work, more of what is the best practice to solve this problem. thanks M -- 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: Advanced Access Control
I've never used Spring Security by itself. It used to be its own project, so it might not be too bad. As far as I know, there are still issues with using Spring in GAE, but maybe those have been solved, and they may not apply to using Spring Security by itself. I'm currently using Apache Shiro. I've been meaning to blog about it, but alas. http://shiro.apache.org/ Shiro will do role based method-level verification, but also allow you to assign arbitrary permissions and assert those at any point. On Jun 18, 6:55 pm, Xel'Ra dominik.karade...@googlemail.com wrote: Hi guys, I wanted to ask for a hint on some technologies I could use for what I want to do with GAE. I am a bit overwhelmed by the huge amounts of different and competing APIs and stuff that I am reading about. I want to do a web page with login. But not for everyone with a google account. I want users to create an account and save data. They shall be the admins of their accounts and be able to create sub-users that can use the app with the respective data. Also they need to be able to restrict access to certain areas for their sub-users. Also it should be possible to, at a later stage, implement a subscription payment model and to check on which membership model they are. According to that they will only be to e.g. create 3 sub-users and save 1000 entries of a string per month. From what I've read on the web the technologies I would need for a project like that are: GAE + GWT + Spring security. Is spring security really the right choice? Am I mistaken? Are there other alternatives for handling user rights? I would be very glad to be pointed in the right direction and literature. I am kinda lost right now. Thank you in advance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Advanced Access Control
I think it would be hard to say there's any standard. GAE is effectively a web environment, which means you can do most web things with it. The Spring guys have a blog post about setting up Spring Security: http://blog.springsource.com/2010/08/02/spring-security-in-google-app-engine/ I have a couple posts on it, the newest being: http://objectuser.wordpress.com/2009/10/24/more-on-spring-security-in-google-app-engine/ There's much more information on Spring Security than Shiro, in my experience. But, for me, it came down to the weight of the solution and its integration with Google Guice. YMMV. :) On Jun 19, 9:14 am, Dominik Karadeniz dominik.karade...@googlemail.com wrote: Thank you. I have never heard of Shiro before, but it seems to be exactly what I need. Do you know whether Shiro is THE standard thing to use for GAE access control. Are there alternatives that you know of? It is always very important to me to make sure a system is somewhat standardized before I use it. Thanks. On Sun, Jun 19, 2011 at 2:57 PM, objectuser kevin.k.le...@gmail.com wrote: I've never used Spring Security by itself. It used to be its own project, so it might not be too bad. As far as I know, there are still issues with using Spring in GAE, but maybe those have been solved, and they may not apply to using Spring Security by itself. I'm currently using Apache Shiro. I've been meaning to blog about it, but alas. http://shiro.apache.org/ Shiro will do role based method-level verification, but also allow you to assign arbitrary permissions and assert those at any point. On Jun 18, 6:55 pm, Xel'Ra dominik.karade...@googlemail.com wrote: Hi guys, I wanted to ask for a hint on some technologies I could use for what I want to do with GAE. I am a bit overwhelmed by the huge amounts of different and competing APIs and stuff that I am reading about. I want to do a web page with login. But not for everyone with a google account. I want users to create an account and save data. They shall be the admins of their accounts and be able to create sub-users that can use the app with the respective data. Also they need to be able to restrict access to certain areas for their sub-users. Also it should be possible to, at a later stage, implement a subscription payment model and to check on which membership model they are. According to that they will only be to e.g. create 3 sub-users and save 1000 entries of a string per month. From what I've read on the web the technologies I would need for a project like that are: GAE + GWT + Spring security. Is spring security really the right choice? Am I mistaken? Are there other alternatives for handling user rights? I would be very glad to be pointed in the right direction and literature. I am kinda lost right now. Thank you in advance. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en. -- 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: App Engine 1.5.1?
Seems like it. I get the same thing, have since yesterday some time. On Jun 18, 3:43 am, Eurig Jones eurigjo...@gmail.com wrote: My dev server is telling me I should upgrade my app to 1.5.1 on startup, but I see no final release of 1.5.1 available yet, only a pre- release! Is this an error on google's part? -- 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] Nested Embedded Classes with JDO
I have an embedded class that embeds another class. In order to remove conflicts with the embedding class, I use the @Embedded annotation like this: class X { @Embedded(members = { @Persistent(name = prop1, columns = @Column(name = yProp1)), @Persistent(name = prop2, columns = @Column(name = yProp2))}) private Y y; ... } However, Y also has an embedded class that may conflict with properties of X. Currently, I do this in Y: class Y { @Embedded(members = { @Persistent(name = prop1, columns = @Column(name = zProp1)), @Persistent(name = prop2, columns = @Column(name = zProp2))}) private Z z; ... } This works, but I think it's more desirable to provide the renames of the properties of Z in X because X is going to be the place where all of the conflicts need to be removed, and I may need different renames in different Xs. However, I don't know the syntax for that. Reading through the JDO docs, I'm not quite able to get if it's even possible. Does anyone know how to do this? Thanks. -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: JSF session beans on GAE
I see JSP session beans are not supported but nothing similar on JSF. I've not had many problems with JSF 2.0 ... seems to work fine with the setup mentioned on that page. On Apr 9, 10:41 am, Uldall christian.uld...@gmail.com wrote: The Will it play in App Engine page states that JSF session beans doesn't work on GAE. Can anyone explain to me why that is? -- 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] Re: DataStore query without transaction - Spring 2.5 + JPA
I've not used Open*InView support in AppEngine (don't like the pattern myself ;). However, if all that is to get around the problem of the transaction limitations like you state just below, then there are a couple of options: - Declare the DAO methods as transaction-new; that way they won't clash - Declare the DAO methods as transaction-not-supported and use JDO (so you don't have to have the .size() hack) Sorry I can't help with the Open*InView thing, but hopefully one of the above helps. On Apr 8, 3:25 pm, Nexus marcin.tok...@gmail.com wrote: I need to use query that fetches objects from multiple entity groups (which means I can't use transactions). Here's the method: @Override public CollectionItem findInactiveItems(Date endDate) { inactiveItems = em.createNamedQuery(findInactiveItems).setParameter(endDate, endDate).getResultList(); if(null == inactiveItems) inactiveItems = new ArrayListItem(); inactiveItems.size(); return inactiveItems; } However, calling getResultList() causes the following error: Caused by: org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed at org.datanucleus.ObjectManagerImpl.assertIsOpen(ObjectManagerImpl.java: 3876) at org.datanucleus.ObjectManagerImpl.getTransaction(ObjectManagerImpl.java: 596) at org.datanucleus.jpa.EntityTransactionImpl.isActive(EntityTransactionImpl.java: 61) at org.datanucleus.jpa.JPAQuery.getResultList(JPAQuery.java:158) I found here on groups the same error posted with suggestions that using OpenEntityManagerInViewFilter should keep entity manager throughout the request. Unforfunately, I can't get this filter working because it tries to create a new entity manager factory while gae allows to create only one of those. Here is part of my web.xml servlet servlet-namecontext/servlet-name servlet-class org.springframework.web.context.ContextLoaderServlet /servlet-class load-on-startup1/load-on-startup /servlet filter filter-nameOpenEntityManagerInViewFilter/filter-name filter- classorg.springframework.orm.jpa.support.OpenEntityManagerInViewFilter/ filter-class init-param param-nameentityManagerFactory/param-name param-valueentityManagerFactory/param-value /init-param /filter filter-mapping filter-nameOpenEntityManagerInViewFilter/filter-name url-pattern*.html/url-pattern /filter-mapping And part of applicationContext.xml: bean id=entityManagerFactory name=entityManagerFactory class=org.springframework.orm.jpa.LocalEntityManagerFactoryBean scope=singleton property name=persistenceUnitName value=transactions-optional / /bean bean id=transactionManager class=org.springframework.orm.jpa.JpaTransactionManager scope=singleton property name=entityManagerFactory ref=entityManagerFactory / /bean And here is the error caused by filter: org.springframework.web.servlet.FrameworkServlet initServletBean: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/allewidok-servlet.xml]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: Provider error. Provider: org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider (...) Caused by: java.lang.IllegalStateException: Application code attempted to create a EntityManagerFactory named transactions-optional, but one with this name already exists! Instances of EntityManagerFactory are extremely slow to create and it is usually not necessary to create one with a given name more than once. Instead, create a singleton and share it throughout your code. If you really do need to create a duplicate EntityManagerFactory (such as for a unittest suite), set the appengine.orm.disable.duplicate.emf.exception system property to avoid this error. at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.checkForRepeatedAllocation(DatastoreEntityManagerFactory.java: 136) at org.datanucleus.store.appengine.jpa.DatastoreEntityManagerFactory.init(DatastoreEntityManagerFactory.java: 64) at org.datanucleus.store.appengine.jpa.DatastorePersistenceProvider.createEntityManagerFactory(DatastorePersistenceProvider.java: 35) at javax.persistence.Persistence.createFactory(Persistence.java:172) So, has anybody actually used OpenEntityManagerInViewFilter on GAE? -- You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group,
[appengine-java] Re: Spring 2.5 Transactions - anyone got this working?
Check your pointcut ... is com.myapp.dao... correct? If that's correct, then I don't see anything amiss; it looks really good. Are you even able to setup a test where it works? Or are you doing it from a test? Oh, and check the use of pm.close(). That should be taken care of by Spring I think. I don't do it in my app anyway. If those don't work, then I'll looks again. On Mar 30, 3:04 pm, Carl Ballantyne carlballant...@gmail.com wrote: Hi objectuser, Thanks for the links - very helpful. I have had a look and studied them. I am trying to get your example to work but am getting the error. org.springframework.transaction.CannotCreateTransactionException: Could not open JDO PersistenceManager for transaction; nested exception is java.lang.IllegalStateException: No JDO PersistenceManager bound to thread, and configuration does not allow creation of non-transactional one here at org.springframework.orm.jdo.JdoTransactionManager.doBegin(JdoTransactionManager.java: 359) As far as I can see I have set up everything as should be but am missing something obvious because it just will not work. It might be something to do with the aop config but I cannot be sure. I have read the Spring documentation and your example which are very similar. Below is my revised spring xml and I have included example dao code as well. If anyone can see what I am doing wrong please correct me. Thanks. SPRING XML - bean id=projectDao class=com.myapp.dao.ProjectDaoJdoImpl property name=pmf ref=persistenceManagerFactoryProxy / /bean bean id=persistenceManagerFactory class=org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean property name=persistenceManagerFactoryName value=transactions- optional / /bean bean id=persistenceManagerFactoryProxy class=org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy property name=targetPersistenceManagerFactory ref=persistenceManagerFactory / property name=allowCreate value=false / /bean bean id=txManager class=org.springframework.orm.jdo.JdoTransactionManager property name=persistenceManagerFactory ref=persistenceManagerFactoryProxy / /bean tx:advice id=txAdvice transaction-manager=txManager tx:attributes tx:method name=clearAndCreate propagation=REQUIRED rollback-for=Throwable / tx:method name=create propagation=REQUIRED rollback- for=Throwable/ tx:method name=update propagation=REQUIRED rollback- for=Throwable / tx:method name=delete propagation=REQUIRED rollback- for=Throwable / tx:method name=* read-only=true/ /tx:attributes /tx:advice aop:config aop:pointcut id=daoMethods expression=execution(* com.myapp.dao.*.*(..))/ aop:advisor advice-ref=txAdvice pointcut-ref=daoMethods/ /aop:config DAO - public class ProjectDaoJdoImpl implements ProjectDao { private PersistenceManagerFactory pmf; public void setPmf(final PersistenceManagerFactory pmf) { this.pmf = pmf; } private PersistenceManager getPersistenceManager() { return pmf.getPersistenceManager(); } public Project read(Long id) { PersistenceManager pm = getPersistenceManager(); try { Project project = pm.getObjectById(Project.class,id); return project; } finally { pm.close(); } } } -- 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] Re: Workaround for Spring transactions throw GenericSignatureFormatError
Thanks, Thomas. It certainly seems like it's worth a shot! On Mar 30, 11:23 pm, Thomas mylee...@gmail.com wrote: Hi kevin: Yes, my workaround is just a proxy which route every pmf requests back to the original instance return by JDOHelper.getPersistenceManagerFactory. I used jdo transaction manager and aop and it worked on gae host after applying the workaround. My spring version is 2.0.8 but I think it could also work on spring 2.5. Thomas -- 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] Re: Workaround for Spring transactions throw GenericSignatureFormatError
Hey, Thomas, Thanks very much for working on this! I think a lot of people want Spring transactions to work in GAE. What does your fix do? Or why does it work? It looks like you're just creating a proxy that passes the invocation along. For example, my jdo-context.xml is below. Is your new bean tied to a transaction manager somehow like the one below? Does having the proxy prevent the AOP engine from throwing the exception? Thanks! ?xml version=1.0 encoding=UTF-8? beans xmlns=http://www.springframework.org/schema/beans; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xmlns:p=http:// www.springframework.org/schema/p xmlns:aop=http://www.springframework.org/schema/aop; xmlns:context=http://www.springframework.org/schema/context; xmlns:jee=http://www.springframework.org/schema/jee; xmlns:tx=http://www.springframework.org/schema/tx; xsi:schemaLocation= http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.5.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd; bean id=persistenceManagerFactory class=org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean property name=persistenceManagerFactoryName value=transactions- optional / /bean bean id=persistenceManagerFactoryProxy class=org.springframework.orm.jdo.TransactionAwarePersistenceManagerFactoryProxy property name=targetPersistenceManagerFactory ref=persistenceManagerFactory / property name=allowCreate value=false / /bean bean id=transactionManager class=org.springframework.orm.jdo.JdoTransactionManager property name=persistenceManagerFactory ref=persistenceManagerFactory / /bean /beans On Mar 28, 11:10 pm, Thomas mylee...@gmail.com wrote: Please refer tohttp://code.google.com/p/googleappengine/issues/detail?id=1381 comment #20 -- 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] Re: Spring 2.5 Transactions - anyone got this working?
I think you're going to be disappointed. Spring transactions work in the SDK but not on the GAE host. Here's how to set them up if you still want to do it (this currently still works for me in the SDK 1.3.2): http://objectuser.wordpress.com/2009/06/30/spring-jdo-in-google-app-engine/ But here's the defect that prevents it from working on the host: http://code.google.com/p/googleappengine/issues/detail?id=1381 On Mar 28, 7:59 am, Carl Ballantyne carlballant...@gmail.com wrote: Hi All, I have been trying for a while now to get Spring managed transactions working on GAE without success. I have searched these forums and the web and find a few examples, all slightly different, and none of which work for me. I am getting the error class javax.jdo.JDOUserException: Transaction is still active. You should always close your transactions correctly using commit() or rollback(). This makes total sense to me in that Spring is not closing the transaction but I don't understand why I am getting it with the following configuration any ideas/ examples greatly appreciated. When I don't use transactions it all works great. But I really need the transactions and would love it to be controlled via Spring. I am using the latest version of GAE 1.3.2. bean id=persistenceManagerFactory class=org.springframework.orm.jdo.LocalPersistenceManagerFactoryBean property name=persistenceManagerFactoryName value=transactions- optional / /bean bean id=txManager class=org.springframework.orm.jdo.JdoTransactionManager property name=persistenceManagerFactory ref=persistenceManagerFactory / property name=jdoDialect ref=dataNucleusJdoDialect/ /bean bean id=dataNucleusJdoDialect class=org.datanucleus.springframework.DataNucleusJdoDialect/ tx:advice id=txAdvice transaction-manager=txManager tx:attributes tx:method name=clearAndCreate propagation=REQUIRED rollback- for=Throwable / tx:method name=create propagation=REQUIRED rollback- for=Throwable/ tx:method name=update propagation=REQUIRED rollback- for=Throwable / tx:method name=delete propagation=REQUIRED rollback- for=Throwable / tx:method name=* propagation=NOT_SUPPORTED read-only=true/ /tx:attributes /tx:advice aop:config aop:advisor pointcut=execution(* com.mydomain.myapp.dao.*.*(..)) advice-ref=txAdvice/ /aop:config -- 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] Re: Help with modeling JDO persistent classes
One way to do this would be to duplicate A.name on the associated Bs. class A { Long id; String name; ... } class B { Long id; Long Aid; Long Aname; ... } Then you'd be able to do your select on just the B entity group and it would work. On Mar 10, 2:59 am, kattus g.adjiashv...@gmail.com wrote: Hi, I have 2 persistent classes: 1. class A that has a primary key (Long) and a property called name (String). 2. class B that is referencing class A (one to many relationship, each B has one A, but A can belong to many B's) I need to retrieve the B's sorted by the name property of A. In other words if it was relational database I would make something like this (simplified): SELECT * FROM A, B WHERE A.id=B.Aid ORDER BY A.name The question is how to make this with JDO. I don't want to make A and B in the same entity group and it seams it is not necessary either, I think using unowned relationships may be a good direction, the help is too basic though: http://code.google.com/appengine/docs/java/datastore/relationships.ht... The questions are: Is it possible to define such a relationship between A and B? If yes how (which annotations)? Do I have to use the Key class in B to reference A? How to use the Google query language to write the correct query? Thank you, Gil -- 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] Re: Do I need unowned relationships to accomplish this...?
How about something like this? class User { Long id; ... } class Deck { Long id; Long userId; ... } class Card { Long id; Long deckId; ... } Then inserting a card into the deck is a simple insert and finding all cards in a deck is a single query. The same for adding a deck to a user. This structure has its own trade-offs, of course. On Mar 10, 4:15 pm, tempy fay...@gmail.com wrote: Exactly, CardList is potentially very large and I want to avoid having to load it just to add the cardreference. On Mar 10, 10:43 pm, WillSpecht willspe...@gmail.com wrote: So if you have a reference to a new card and do cardList.add(cardRefference) all you are loading into memory is the card list and the new card. Is this what you are trying to avoid? On Mar 10, 4:06 pm, tempy fay...@gmail.com wrote: Actually cards can only be owned by one deck... so that's not a problem. Deck--1...0toN--card. The thing that I am looking for is a way to add new cards without loading a deck's entire card collection, and to add decks without loading a User's entire deck collection. On Mar 10, 9:15 pm, WillSpecht willspe...@gmail.com wrote: The way I understand it, if an object can be owned by more than one object it must be unowned. I would assume that cards can be in multiple decks so they must be unowned. I would assume each deck would belong to one user so decks could be owned. I don't know a good way to store cards that can be queried in one query unless you have each card store what decks they are in. This could be even more difficult if cards appear more than once in a deck. If that is true I would suggest a join table. On Mar 10, 2:20 pm, tempy fay...@gmail.com wrote: I have the following datastructure: Users are the root entities, and each user can have one or more decks, and each deck can have one or more cards. When a user wants to add a deck, I would like to be able to add the deck to the user's collection of decks without first fetching all of the user's decks (potentially a large amount of data), then adding the new deck to that collection, and then persisting the user. Rather, I would like to simply instantiate the deck and append it to the user's collection of decks, without ever retrieving the entire collection. Similarly, if a user wants to add a new card to an existing deck, I would like to add the card to the deck without first retrieving the entire deck (that is, the deck with all of its cards). I would like to preserve the option of fetching a user with a populated collection of all their decks and to retrieve a deck with a populated collection of all its cards, which is possible with owned relationships. But to accomplish what I have mentioned above, would I be forced to use unowned relationships? (Collections of keys instead of collections of objects.) Thanks, Mike -- 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] Re: Best practices for datastore and JDO?
I think the gap here is that a RDBMS (PostgreSQL) and the App Engine Datastore are totally different. In fact, I think the latter influences your design much more than the former. The sorts of joins you used to be able to do in your DB to efficiently retrieve data don't work in the GAE datastore. You need to build your data model around the queries you want to run efficiently. To say again, your data needs to be modeled to support your most important queries. I go through some of the reasoning in the modeling section of my blog (I've been away from GAE for a while so some of this could have changed): http://objectuser.wordpress.com/google-app-engine/ However, if you've not done so, I highly recommend reading the Google documentation: http://code.google.com/appengine/docs/java/datastore/ On Mar 5, 6:54 am, vennervald jacob.vennerv...@gmail.com wrote: Hi Guys We have a small application running on JBoss, Seam, Hibernate and PostgreSQL that we are thinking about moving to GAE/J. To test the datastore we uploaded our data 1-1 so all our tables from Postgres were represented as entity types in the datastore with the entities relating to eachother through their keys. As a proof of concept of the performance of the datastore, we did an implemented one of our heaviest reports by joining 6 entities together. And the performance proved to be really bad. Infact we received the deadline exception before we got to join all the entities. From the platform we are running on now, this could be done in less than a second. This doesn't tell me that Google datastore is worthless. It tells me, that I'm doing something wrong, and that I need to think differently about the data structures to make it perform on GAE. I've been looking around and I can't seem to find really good sources on datastore/JDO best practises. Does anybody have any good resources on this toppic? I would really apriciate your help. /Jacob :) -- 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] Re: Should I use JPA or JDO for DataStore?
Since you're a student, and if you have the time, I'd recommend learning JDO for the following reasons: 1. You already know JPA. Might as well learn something new. :) 2. JDO, imo, fits the GAE datastore much better (I think there are quite a few discussions around here as to why). Enjoy! On Mar 6, 8:28 am, itsnotvalid itsnotva...@gmail.com wrote: Just in cast I want to make use of some existing Java APIs for messing with DataStore, which may be the low-level API would work the best. I just wonder, as I am still a college student, one of my lecturer told me that we should use JPA (2.0) now as JDO is not the preferred way for persisting data in JavaEE anymore. I just wonder, however, for the case with App Engine (which now most of my assignments are implemented using JPA 2.0 with EclipseLink, however,) is it best to use JPA or should I follow most tutorials and use JDO instead? In view of the implementation of both APIs in App Engine, which one is more robust, or which would is better in terms of performance? Hope to see Google staff to answer this newbie question. Thanks. Alan(@itsnotvalid) -- 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] Re: My recommendation: Use Low-Level API instead of JDO/JPA
You rock. I'll give it a try. Thanks! On Sep 24, 3:25 pm, Alejandro D. Garin aga...@gmail.com wrote: Hi objectuser, yes, currently I have a project to share this kind of code and an online demo with source code. Advice class (RetryAdvice.java): (I have an advice for cache too - see CacheAdvice.java)http://code.google.com/p/puntosoft/source/browse/trunk/#trunk/src/ar/... Demo: Spring configurations for the demo: (how to configure the advice and the pointcuts)http://code.google.com/p/puntosoft/source/browse/trunk/#trunk/war/WEB... Demo source code:http://code.google.com/p/puntosoft/source/browse/trunk/#trunk/src/ar/... demo online code:http://puntosoft2k.appspot.com/Showcase.html I'm using this advice (the retry and the cache) in my production application and it's working fine. Please tell me what you think, contributions or ideas are welcome. Regards. On Thu, Sep 24, 2009 at 4:16 PM, objectuser kevin.k.le...@gmail.com wrote: Alejandro, is this code you can share? I'd much appreciate it if so! On Sep 24, 12:08 pm, Alejandro D. Garin aga...@gmail.com wrote: I'm using Spring with AOP, I have created an AOP advice to retry some datastore operations. With this approach I don't have any retry related code in my DAO or Service. --~--~-~--~~~---~--~~ 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: Type Owned by Two Different Types?
Here's some code that reproduces my problem. Before the code, I think it's interesting to note that I started making this example in JPA (because I had an old test that used JPA) and I was not able to reproduce the error. However, after converting to JDO, I get the error. I'm not 100% sure the code is exactly the same, however, but wanted to note it in case it's helpful to anyone. LocalServiceTestCase is based on the examples from Google. Does anyone see a problem with the code or is this a legit bug? @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class ParentOfOne { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private SharedChild child; ... } @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class ParentOfList { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; @Persistent private ListSharedChild children; ... } @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = true) public class SharedChild { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private String name; ... } public class SharedChildTestCase extends LocalServiceTestCase { private PersistenceManager persistenceManager; @Before public void openPersistenceManager() { PersistenceManagerFactory persistenceManagerFactory = JDOHelper .getPersistenceManagerFactory(transactions-optional); persistenceManager = persistenceManagerFactory.getPersistenceManager (); } @After public void closePersitenceManager() { persistenceManager.close(); } @Test public void saveParents() { ParentOfList pol = new ParentOfList(); ListSharedChild list = new ArrayListSharedChild(); SharedChild c1 = new SharedChild(); c1.setName(c1); list.add(c1); SharedChild c2 = new SharedChild(); c2.setName(c2); list.add(c2); pol.setChildren(list); persistenceManager.makePersistent(pol); ParentOfOne poo = new ParentOfOne(); SharedChild c3 = new SharedChild(); c1.setName(c3); poo.setChild(c3); persistenceManager.makePersistent(poo); } } On Sep 22, 9:40 am, objectuser kevin.k.le...@gmail.com wrote: Thanks, Marton. That's very unfortunate. The limitations still surprise me. Is that documented somewhere? Need to go back and reread that stuff I guess. I'll see if I can come up with a simple test case for the collection. On Sep 22, 3:28 am, Marton Papp mapr...@gmail.com wrote: A class cannot have two different owned relationship to a single class. For example if I have these two classes: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Parent3 { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; Child1 child1; Child1 child2; // ... get-set } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Child1 { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; // ... get-set } then this code will fail with an assertion error: public void testMultiParent2() throws Exception { PersistenceManager pm; Parent3 p3 = null; Parent3 p3Loaded = null; pm = pmf.getPersistenceManager(); pm.currentTransaction().begin(); p3 = new Parent3(); p3.setChild1(new Child1()); p3.setChild2(new Child1()); pm.makePersistent(p3); pm.currentTransaction().commit(); pm.close(); pm = pmf.getPersistenceManager(); pm.currentTransaction().begin(); p3Loaded = pm.getObjectById(Parent3.class, p3.getId()); Assert.assertNotSame(p3Loaded.getChild1(), p3Loaded.getChild2()); pm.currentTransaction().commit(); pm.close(); } It is because the datastore represents the relationship between Child1 and Parent3 instances by making the Parent3 instance the parent of the Child1 instance. And it does the same for both Parent3.child1 and Parent3.child2 relationships, so there is no way to tell which property a particular instance of Child1 has been assigned to originally. I could
[appengine-java] Re: will it make any difference if i do not provide a separate class (PMF) for PersistentManagerFactory
I think the key is to not create them all the time. So don't make a new one for each transaction. Make one and keep it around. On Sep 23, 10:19 am, Prashant antsh...@gmail.com wrote: Hi, Will it make any difference to the performance of the app if I do not write a separate class (PMF, as suggested in GAE docs) for getting PersistentManagerFactory instance, instead, I declare it as a variable in the class where I want to use it, like protected final PersistenceManagerFactory pmf = JDOHelper.getPersistenceManagerFactory(transactions-optional); // NOTE: I am not using *static* keyword. Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Type Owned by Two Different Types?
Thanks, Marton. That's very unfortunate. The limitations still surprise me. Is that documented somewhere? Need to go back and reread that stuff I guess. I'll see if I can come up with a simple test case for the collection. On Sep 22, 3:28 am, Marton Papp mapr...@gmail.com wrote: A class cannot have two different owned relationship to a single class. For example if I have these two classes: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Parent3 { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; Child1 child1; Child1 child2; // ... get-set } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Child1 { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; // ... get-set } then this code will fail with an assertion error: public void testMultiParent2() throws Exception { PersistenceManager pm; Parent3 p3 = null; Parent3 p3Loaded = null; pm = pmf.getPersistenceManager(); pm.currentTransaction().begin(); p3 = new Parent3(); p3.setChild1(new Child1()); p3.setChild2(new Child1()); pm.makePersistent(p3); pm.currentTransaction().commit(); pm.close(); pm = pmf.getPersistenceManager(); pm.currentTransaction().begin(); p3Loaded = pm.getObjectById(Parent3.class, p3.getId()); Assert.assertNotSame(p3Loaded.getChild1(), p3Loaded.getChild2()); pm.currentTransaction().commit(); pm.close(); } It is because the datastore represents the relationship between Child1 and Parent3 instances by making the Parent3 instance the parent of the Child1 instance. And it does the same for both Parent3.child1 and Parent3.child2 relationships, so there is no way to tell which property a particular instance of Child1 has been assigned to originally. I could not reproduce your problem with the list of children. Could you send some code that fails for you? Marton On Sep 22, 3:31 am, objectuser kevin.k.le...@gmail.com wrote: After some more testing this is what I observe: - If A has one C property and B has two C properties, I can save both the A and the B instances, when I get the B instance, both C properties point to the same instance of C. - If A has one C property and B has a property that is a List of Cs, I get the exception in my original post. I guess I need to work this down to a repeatable example and file a defect report. On Sep 21, 2:49 pm, objectuser kevin.k.le...@gmail.com wrote: I'll let leszek talk more about the code, but I assumed that the commented out line was just testing both scenarios. In the scenario without comment on the line, it would be my scenario: the same owned type but not the same owned instance. My original question is not about one particular entity having two parents (in an owned relationship), but having two entity groups share the same owned Java type. Does that make sense? On Sep 21, 2:00 pm, Marton Papp mapr...@gmail.com wrote: Hi, The code in that form also works for me, but just because the exception is caught and never reported. If you rethrow any exceptions from the catch blocks than you should get something like the following: Detected attempt to establish Parent2(3) as the parent of Parent1(1)/ Child1(2) but the entity identified by Parent1(1)/Child1(2) is already a child of Parent1(1). A parent cannot be established or changed once an object has been persisted. org.datanucleus.exceptions.NucleusUserException: Detected attempt to establish Parent2(3) as the parent of Parent1(1)/Child1(2) but the entity identified by Parent1(1)/Child1(2) is already a child of Parent1 (1). A parent cannot be established or changed once an object has been persisted. at org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch (DatastoreRelationFieldManager.java:214) at org.datanucleus.store.appengine.DatastoreRelationFieldManager $1.setObjectViaMapping(DatastoreRelationFieldManager.java:129) at org.datanucleus.store.appengine.DatastoreRelationFieldManager $1.apply(DatastoreRelationFieldManager.java:108) at org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations (DatastoreRelationFieldManager.java:80) at org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations (DatastoreFieldManager.java:795) at org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess (DatastorePersistenceHandler.java:288
[appengine-java] Re: Type Owned by Two Different Types?
Thanks! I'd certainly rather it be something I'm doing wrong. I think you have represented my exact scenario there. I'll continue looking at my code. On Sep 21, 9:49 am, leszek leszek.ptokar...@gmail.com wrote: That's very interesting because it works for me: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Employee { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; private String firstName; private String lastName; } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class A (B) { public Long getId() { return id; } public void setId(Long id) { this.id = id; } public Employee getE() { return e; } public void setE(Employee e) { this.e = e; } @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; } (regardless if transaction is used or not - simply makePersistent without transaction) PersistenceManager em = EMF.get().getPersistenceManager(); Employee e = null; try { em.currentTransaction().begin(); A a = new A(); e = new Employee(); a.setE(e); em.makePersistent(a); em.currentTransaction().commit(); } catch (Exception ee) { em.currentTransaction().rollback(); } try { em.currentTransaction().begin(); B b = new B(); // e = new Employee(); b.setE(e); em.makePersistent(b); em.currentTransaction().commit(); } catch (Exception ee) { em.currentTransaction().rollback(); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: JDO : How to make an unowned reference to an entity if we don't know its key yet ?
Because your relationships are unowned (so the objects are in different entity groups, right?), you wouldn't be able to save them all in the same transaction anyway. So you're right: you'll have to save them, which means multiple transactions, and if one of them fails you'll have inconsistent data. On Sep 19, 8:47 am, mlenormand mickael.lenorm...@gmail.com wrote: Hi Everybody, Here's my problem with JDO and unowned relationships : I have several entities of the same kind that are organized in a hierarchical way, maintained with unowned relationships. JDO can generate keys for my entities when they are written to the datastore, but with this option, I can't know my entity's keys until they are saved to the datastore. If I want to make a reference to an entity A from an entity B, it seems to be impossible because at this time I don't know A's key, that will be generated when transaction is committed. One solution would be to use several transactions, each one would persist an entity, but it's not good because I want to persist all the entities in the same transaction. I know that defining keys myself could solve the problem, but maybe there is an other solution that would be better ? Thank you for your help. And thank you to the GAE team for the fantastic work you did ! --~--~-~--~~~---~--~~ 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: Owned One-to-One Relationship and Owned One-to-Many Relationship aren't compatible
Jason, is it also true that you can't have two one-to-one relationships of the same kind? I'm able to save such a relationship, but when I fetch it, I get the same child in both values. I need to debug further (would not be surprised if it's just something I'm doing wrong), but wondering if it's just a known issue. On Sep 17, 4:12 pm, Jason (Google) apija...@google.com wrote: This is a known issue. At present, you can't have both a one-to-one and one-to-many relationship of the same kind. - Jason On Tue, Sep 15, 2009 at 2:57 PM, Tim timk...@gmail.com wrote: It appears that these two statements work individually but not together. �...@persistent private ContactInfo manager; �...@persistent private ListContactInfo staff = new ArrayListContactInfo(); Change either @Persistent to @NotPersistent and the unit test succeeds. SDK: appengine-java-sdk-1.2.5 ** Stack Trace *** java.lang.ClassCastException: oid is not instanceof javax.jdo.identity.ObjectIdentity at roster.ContactInfo.jdoCopyKeyFieldsFromObjectId(ContactInfo.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:132) at org.datanucleus.store.appengine.DatastoreRelationFieldManager $1.apply(DatastoreRelationFieldManager.java:108) at org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations (DatastoreRelationFieldManager.java:80) at org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations (DatastoreFieldManager.java:795) 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 testing.TestContactInfo.testTwoRelationShips(TestContactInfo.java: 75) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:164) at junit.framework.TestCase.runBare(TestCase.java:130) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:120) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run (JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run (TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests (RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run (RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main (RemoteTestRunner.java:197) *ContactInfo.java * import javax.jdo.annotations.IdGeneratorStrategy; import javax.jdo.annotations.IdentityType; import javax.jdo.annotations.PersistenceCapable; import javax.jdo.annotations.Persistent; import javax.jdo.annotations.PrimaryKey; import com.google.appengine.api.datastore.Key; @PersistenceCapable(identityType = IdentityType.APPLICATION) public class ContactInfo { �...@primarykey �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key contactInfoKey; �...@persistent private String
[appengine-java] Re: Many to Many
Right, I'd read the docs like Ian mentioned. The big caveat as with anything in GAE is that the queries you intend to perform will drive your model. There's more than one way to model a many to many, so you need to make sure that the model you choose supports the queries you need. On Sep 14, 7:06 am, Anita an...@ensarm.com wrote: Hi, Can any one provide me with a good example of unowned many-many relationship with jdo. I refered to the doc but could not find any good example to relate 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-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: Snow Leopard Trouble
And everything worked fine before the upgrade? I'm not using GWT, but upgraded to Snow Leopard with no resulting issues for GAE. On Aug 31, 1:51 am, yasuyuki eyasuy...@gmail.com wrote: Hi. I use Eclipse 3.4.2 and GAE/J Plugin. I update my Mac to Mac OS 10.6 Snow Leopard, I caught an error when start my appengine project below: You must use a Java 1.5 runtime to use GWT Hosted Mode on Mac OS X. My Snow Leopard has 64-bit or 32-bit JRE 1.6 ontly, has not JRE 1.5. How to run GAE/J on Snow Leopard ? thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: jsp.error.beans.property.conversion
I think one difference might be your use of JSPs. I'm using JSF 2.0 but with XHTML. But that's just a guess. Did you follow the instructions here? https://sites.google.com/a/wildstartech.com/adventures-in-java/Java-Platform-Enterprise-Edition/JavaServer-Faces/sun-javaserver-faces-reference-implementation/configuring-jsf-20-to-run-on-the-google-appengine On Sep 3, 6:35 am, Piotrek test200909...@gmail.com wrote: Hello, I was trying to run JSF (Mojarra implementation) with google apps engine. I tried both 1.2 and 2.0 versions. My test page was simple, just: f:view h:outputText value=tralala/ /f:view Whenever I tried to view this page (under developer appserver) I received such error: HTTP ERROR: 500 jsp.error.beans.property.conversion RequestURI=/test.faces Caused by: org.apache.jasper.JasperException: jsp.error.beans.property.conversion at org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager (JspRuntimeLibrary.java:885) at org.apache.jsp.test_jsp._jspx_meth_h_outputText_0(test_jsp.java: 123) at org.apache.jsp.test_jsp._jspx_meth_f_view_0(test_jsp.java:98) at org.apache.jsp.test_jsp._jspService(test_jsp.java:62) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94) at javax.servlet.http.HttpServlet.service(HttpServlet.java:806) (...) I looked at compiled test_jsp.java, around line 123. It looked like that: _jspx_th_h_outputText_0.setPageContext(_jspx_page_context); _jspx_th_h_outputText_0.setParent((javax.servlet.jsp.tagext.Tag) _jspx_th_f_view_0); _jspx_th_h_outputText_0.setValue((javax.el.ValueExpression) org.apache.jasper.runtime.JspRuntimeLibrary.getValueFromPropertyEditorManager (javax.el.ValueExpression.class, value, tralala)); int _jspx_eval_h_outputText_0 = _jspx_th_h_outputText_0.doStartTag(); (...) I guessed it had something to do with Jasper. So I entered the directory google_app_engine/appengine-java-sdk-1.2.2/lib/shared/jsp. There I deleted files repackaged-appengine-jasper-compiler-5.0.28.jar and repackaged-appengine-jasper-runtime-5.0.28.jar. Then I downloaded Tomcat (version 6.0.20) and I found in it files jasper-el.jar, jasper.jar and tomcat-juli.jar. I copied them to google_app_engine/ appengine-java-sdk-1.2.2/lib/shared/jsp. After that error dieappeared when I run my application under developmnent server. However, when I upload it to appspot, it fails with 500 error code. Log says something about NullPointerException, but I don't remember details now. Have any of you encountered problem like that? I read that people use JSF with GAE. Maybe somebody could post a full zipped example of a project using JSF under GAE? Maybe I do something wrong and I could find it by comparing my broken code with such working example? --~--~-~--~~~---~--~~ 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: Relationships
I really recommend you read the documentation: http://code.google.com/appengine/docs/java/datastore/overview.html You are trying to do things the datastore does not allow. It's so different that a relational datastore, I think you'll find you're constantly roadblocked if you don't become familiar with it. On Aug 26, 5:42 am, midomarocain elattar...@gmail.com wrote: i use three class User , Type ,and Article : @PersistenceCapable(identityType = IdentityType.APPLICATION) public class User { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; @Persistent private String login; @Persistent private Type type; ... } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Type { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; ... } @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Article { @PrimaryKey �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Long id; �...@persistent private User user; . } I use this method to save the article : public static Article save(Article article, Long userId) { Article result = null; PersistenceManager pm = PMF.get().getPersistenceManager(); try { // Getting the user by id Query query = pm.newQuery(User.class, id == idParam); query.declareParameters(Long idParam); ListUser users = (ListUser) query.execute(userId); User user = null; if (!users.isEmpty()) { user = users.get(0); } article.setUser(user); result = pm.makePersistent(article); } finally { pm.close(); } return result; } the exception : javax.jdo.JDOFatalUserException: Detected attempt to establish Article (16) as the parent of User(14) but the entity identified by User(14) has already been persisted without a parent. A parent cannot be established or changed once an object has been persisted. at org.datanucleus.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException (NucleusJDOHelper.java:354) at org.datanucleus.jdo.JDOPersistenceManager.jdoMakePersistent (JDOPersistenceManager.java:674) at org.datanucleus.jdo.JDOPersistenceManager.makePersistent (JDOPersistenceManager.java:694) .. thanks in advance On 25 août, 17:14, objectuser kevin.k.le...@gmail.com wrote: Can you tell us what the error is? And maybe some snippits of code showing the relevant parts of your model and how it's mapped? On Aug 25, 8:08 am, midomarocain elattar...@gmail.com wrote: I have a relation between a User and Article (1) User can have one or many article (2) an article is owned by only one user i'am intersted only by the relation (2) the User is persisted I create a new Article and i want relie it with an existant User But i have a probleme when trying to persist the article object my code is like article.setUser(user); pm.makePersistent(article); can any one help me please --~--~-~--~~~---~--~~ 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: Service logic conflicts with transaction policy for entity groups
Hey, Vince, That's really cool. Does that address the need of the OP though? I may just not be understanding it fully ... Thanks! On Aug 26, 11:15 am, Vince Bonfanti vbonfa...@gmail.com wrote: I've implemented a set of distributed locks for GAE that I posted a message about previously (especially note the current limitations of reliability of shared/read locks): http://groups.google.com/group/google-appengine-java/browse_thread/th... Here's a direct link to the source code: http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlant... Since posting that message, I've done some timings on memcache calls and found that they usually take about 15ms; I've seen low times around 6-7ms and high times as much as 60ms. The ExclusiveLock is the most efficient, since it takes only one memcache call to acquire and one to release. If you use the ReadWriteLock class, it takes two memcache calls to acquire a write lock, and three memcache calls to acquire a read lock (it only takes one memcache call to release either a write or read lock). So, while using ReadWriteLock allows the greatest concurrency in your application, unless the read operations take longer than 45ms on average, you might be better off using ExclusiveLocks. Let me know if you find this useful. Vince On Wed, Aug 26, 2009 at 10:31 AM, randalrdgo...@gmail.com wrote: Hello. I'm trying to create a service method that encapsulates a particular business logic. I want to make this feature transactional such that its job is accomplished atomically(?). The problem is the service logic involves accessing different entities that do not belong to the same entity group which is not allowed in GAE. At the moment, I've temporarily disabled transaction management to the service method. However, I feel I'd need to manage transactions eventually. I'm thinking of revising the model design but from how I see it, the model classes are good as they are--unrelated by ownership. Btw, within the service logic is some methods that are transactional. I'm using Spring framework to annotate transaction management. Can anyone help me on how I can go about this? Thanks. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Service logic conflicts with transaction policy for entity groups
I see what you're saying ... you're addressing the integrity issues around concurrent modifications. As is, what if someone makes an inconsistent modification to A while I'm trying to update B ... I was thinking of it in terms of, what if modify entity A works and modify entity B fails. Good stuff! On Aug 26, 11:51 am, Vince Bonfanti vbonfa...@gmail.com wrote: I thought it did, but I may not have fully understood the question. Using distributed locks would allow him to implement atomicity (synchronization) of transactions in his application code without modifying his data model, something like this: exclusiveLock.lock(); try { // modify entity A // modify entity B } finally { exclusiveLock.unlock(); } Assuming that entities A and B are in different entity groups, and therefore he can't use the built-in transaction support provided by the datastore. Vince On Wed, Aug 26, 2009 at 12:44 PM, objectuserkevin.k.le...@gmail.com wrote: Hey, Vince, That's really cool. Does that address the need of the OP though? I may just not be understanding it fully ... Thanks! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Any example for JPA One-To-Many relationship
It's not really any different in JPA and JDO, so the docs should cover what you want. http://code.google.com/appengine/docs/java/datastore/relationships.html I also wrote a few things that used JPA if it's useful (under the Modeling section): http://objectuser.wordpress.com/google-app-engine/ On Aug 24, 10:32 pm, niuy michael...@gmail.com wrote: Hi there, I am struggling to implements one-to-many relationship ,but I never make it work. Does any body make any relationship based on JPA? or it is impossible on GAE / J ? Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Object manager has been closed (GAE with Spring)
+1 to Wagner for a better way of determining the issue. :) On Aug 24, 12:25 pm, Wagner Aioffi wagner.aio...@gmail.com wrote: Hi, I got the same exception using the persistence manager (jpa) outside a spring transaction. Is it your case? W. 2009/8/24 randal rdgo...@gmail.com On Aug 24, 4:44 am, objectuser kevin.k.le...@gmail.com wrote: Do you get it when you're trying to walk the graph on an object? If you add that property to the defaultFetchGroup does it fix it? I'm not sure I got that. What I do with the test, I call on a DAO object that uses JdoTemplate to accomplish its task. Then, I invoke a JdoTemplate from within my test case built around the same PersistenceManagerFactory to help me check on the side effects of the data access method I'm testing--asserting states, etc. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send email to google-appengine-java@googlegroups.com To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en -~--~~~~--~~--~--~---
[appengine-java] Re: Object manager has been closed (GAE with Spring)
For a general solution (that will work it tests and outside of tests ... and you might want to verify that the OpenPersistenceManagerInViewFilter will work on the GAE host), you'll likely need to look into fetch groups. On Aug 24, 12:50 pm, randal rdgo...@gmail.com wrote: On Aug 25, 1:44 am, objectuser kevin.k.le...@gmail.com wrote: +1 to Wagner for a better way of determining the issue. :) Yeah, that pretty much says it. If I'm not mistaken, JdoTemplate takes the persistence manager from the OpenPersistenceManagerInViewFilter, or any existing transaction. I'll check on this. --~--~-~--~~~---~--~~ 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: Local transactions do not rollback
That's crazy, John. Is all the data still there or only some of it? Also, how is your transaction being demarcated? On Aug 21, 1:41 am, jd jdpatter...@gmail.com wrote: Hi, I am using the local sdk datastore to save several thousand of objects and when an exception occurs the data is not rolled-back and the data is still in the datastore. I can see in the log INFO: Time to persist datastore: 1140 ms which seems to indicate the data is being flushed to disk. Is this documented somewhere? Thanks, John --~--~-~--~~~---~--~~ 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: query performance
I agree with Iain: it depends on how many items are in the lists. But for large lists, I don't think it would work out very well. Are the values in listA and listB stored? That might give you more options. On Aug 20, 8:15 pm, Ray Li ray.lee@gmail.com wrote: Hi, I have a query filter on an entity Person that person.name be in listA and person.country in listB. As far as I can see, there're 2 options: 1. Create a query select t from Person t where t.name = :listAElement and t.country = :listBElement and run it listA.size() * listB.size() times, then combine the result sets. 2. Create a query select t from Person t where t.name =:listAElement and run it once, then for each entity in the resultset, check if its country is in listB. For option 1, I am not sure about querying the datastore too many times will case a serious performance issue. For option 2, I may have to get all results back, may be several several thousands, and this may be not achievable, is it? Any help is highly appreciated. Thanks, Ray --~--~-~--~~~---~--~~ 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: Granite Data Services Blog
The last line made me laugh! I think some of the GraniteDS team has published an app on GAE and actually made the source available. Have you search for that? On Aug 17, 1:17 am, Capsicum annuum huayun...@gmail.com wrote: I want to build a flex project with GAE, and i want to use JDO Detach. My English is poor. It's Doc is poor 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-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 -~--~~~~--~~--~--~---