[appengine-java] Developers being removed from permissions list
I have added a developer to my app engine project simply to send mail. (no-re...@myapp.com). This is a real email address. I verified the invite and everything was fine. A few days later, users are not receiving confirmation emails, sent from no-reply. It turns out he was removed from the developers permission list. I am the only person able to change the permission list, and I didn't remove him. What caused this to happen? Is this something I need to keep an eye on? What is the appropriate way to handle no-reply addresses if this is not the suggested approach? -- 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/-/jxpriscBEOAJ. 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] Problem with CSS on deployment
So looks like I just have to wait till this update pushes to eclipse. -- 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/-/lgHHYlgPfEAJ. 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] Problem with CSS on deployment
Since I upgraded to the latest SDK my css has been acting really weird. On random deployments my CSS does not load at all. I then redeploy my site a few times with no code changes, and the CSS works fine. I tried to look at the CSS in chrome. If I open the resources panel and click on my main.css I see nothing, but if I click on the resource, it opens it fine in a new tab. Once the CSS is working again this does not happen, I can see the file in the resource window. This is a pretty big problem for me, sometimes redeployment needs to be done 5-6 times and takes about 10 min. -- 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/-/Xk9YMOQaCLkJ. 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] Always on - control number of always on instances
For the new billing, are we able to control how many instances are always on? Will I be able to only have one or two instances always 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.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] Re: Mobile subdomain in app engine
I was looking for an easy way to do this once and make it work for the whole site. Now I realize I'm going to have to go into every servlet and have it choose which jsp to display. On Oct 6, 6:43 pm, WillSpecht wrote: > My real problem is that I can't figgure out how to show war/mobile/ > home.jsp when a user types in m.mydomain.com/home. > > On Oct 6, 5:55 pm, Nichole wrote: > > > > > > > > > I should add that my simplified model above uses the given static > > examples without a redirect to a /site/mobile. > > By 'design for all viewports' I mean design to use floating right divs > > when possible... > > > On Oct 6, 2:50 pm, Nichole wrote: > > > > I'm not using a pseudo-2-site model myself anymore as I recently > > > simplified my structure. > > > For SDK 1.5.2 I had errors upon submitting for deployment more than > > > static 100 files, so keep that in mind. > > > If SDK 1.5.5 increased the max of number of static files to be > > > uploaded, or your files are within limit, > > > next keep in mind that appengine implementation of > > > javax.Servlet.Filters work upon dynamic > > > content (filters are not applied to static content at this time). > > > So if you need to sense the user agent on server-side using your > > > library of preference, make sure that > > > your welcome file is a jsp file in order for your browser agent filter > > > to intercept > > > up the request. > > > If you are instead using a static html file that includes javascript > > > to sense the > > > viewport size (= document.width) and then redirect, you won't need to > > > use a javax.servlet.Filter > > > and can replace the welcome file with your index.html instead > > > (caveat is that if you advertise, you won't be able to use that > > > default url as it will now result in a redirect). > > > > Here's how it could work w/ welcome file index.html: > > > > If you had webapp directories: > > > /site/ > > > /site/mobile/ > > > > in appengine-web.xml use: > > > /site > > > > > > > > > > > > > > > > > > > > > > in web.xml use: > > > > > > 404 > > > /error.html > > > > > > > > > index.html > > > > > > > I'll leave the app version that uses an index.jsp welcome file and a > > > browser agent filter up to you, but it should work similarly. > > > > On Oct 6, 7:10 am, WillSpecht wrote: > > > > > Things will be slightly different on the mobile site. I have checked > > > > out jquery mobile and its how I want to write the mobile site. I > > > > think the layout of the two sites will be too different to do on one > > > > page. > > > > > On Oct 5, 9:49 pm, Nichole wrote: > > > > > > Have you thought of designing for all viewports from the start instead > > > > > of a redirect? > > > > > see the new jquery library > > > > > > http://jquerymobile.com > > > > > > On Oct 4, 11:57 am, WillSpecht wrote:> Can > > > > > someone give me a basic rundown of how to set up a mobile site on > > > > > > app engine. I already have a standard site set up but I want to use > > > > > > the same data store to run a mobile site. > > > > > > > I would like to redirect mobile users to m.mydomain.com. Basically > > > > > > both sites will be the same I just want to show them different jsp > > > > > > pages. -- 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: Mobile subdomain in app engine
My real problem is that I can't figgure out how to show war/mobile/ home.jsp when a user types in m.mydomain.com/home. On Oct 6, 5:55 pm, Nichole wrote: > I should add that my simplified model above uses the given static > examples without a redirect to a /site/mobile. > By 'design for all viewports' I mean design to use floating right divs > when possible... > > On Oct 6, 2:50 pm, Nichole wrote: > > > > > > > > > I'm not using a pseudo-2-site model myself anymore as I recently > > simplified my structure. > > For SDK 1.5.2 I had errors upon submitting for deployment more than > > static 100 files, so keep that in mind. > > If SDK 1.5.5 increased the max of number of static files to be > > uploaded, or your files are within limit, > > next keep in mind that appengine implementation of > > javax.Servlet.Filters work upon dynamic > > content (filters are not applied to static content at this time). > > So if you need to sense the user agent on server-side using your > > library of preference, make sure that > > your welcome file is a jsp file in order for your browser agent filter > > to intercept > > up the request. > > If you are instead using a static html file that includes javascript > > to sense the > > viewport size (= document.width) and then redirect, you won't need to > > use a javax.servlet.Filter > > and can replace the welcome file with your index.html instead > > (caveat is that if you advertise, you won't be able to use that > > default url as it will now result in a redirect). > > > Here's how it could work w/ welcome file index.html: > > > If you had webapp directories: > > /site/ > > /site/mobile/ > > > in appengine-web.xml use: > > /site > > > > > > > > > > > > > > > in web.xml use: > > > > 404 > > /error.html > > > > > > index.html > > > > > I'll leave the app version that uses an index.jsp welcome file and a > > browser agent filter up to you, but it should work similarly. > > > On Oct 6, 7:10 am, WillSpecht wrote: > > > > Things will be slightly different on the mobile site. I have checked > > > out jquery mobile and its how I want to write the mobile site. I > > > think the layout of the two sites will be too different to do on one > > > page. > > > > On Oct 5, 9:49 pm, Nichole wrote: > > > > > Have you thought of designing for all viewports from the start instead > > > > of a redirect? > > > > see the new jquery library > > > > > http://jquerymobile.com > > > > > On Oct 4, 11:57 am, WillSpecht wrote:> Can > > > > someone give me a basic rundown of how to set up a mobile site on > > > > > app engine. I already have a standard site set up but I want to use > > > > > the same data store to run a mobile site. > > > > > > I would like to redirect mobile users to m.mydomain.com. Basically > > > > > both sites will be the same I just want to show them different jsp > > > > > pages. -- 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: Mobile subdomain in app engine
Things will be slightly different on the mobile site. I have checked out jquery mobile and its how I want to write the mobile site. I think the layout of the two sites will be too different to do on one page. On Oct 5, 9:49 pm, Nichole wrote: > Have you thought of designing for all viewports from the start instead > of a redirect? > see the new jquery library > > http://jquerymobile.com > > On Oct 4, 11:57 am, WillSpecht wrote:> Can someone > give me a basic rundown of how to set up a mobile site on > > app engine. I already have a standard site set up but I want to use > > the same data store to run a mobile site. > > > I would like to redirect mobile users to m.mydomain.com. Basically > > both sites will be the same I just want to show them different jsp > > pages. -- 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] Mobile subdomain in app engine
Can someone give me a basic rundown of how to set up a mobile site on app engine. I already have a standard site set up but I want to use the same data store to run a mobile site. I would like to redirect mobile users to m.mydomain.com. Basically both sites will be the same I just want to show them different jsp pages. -- 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] Delay for later request
I am have created a search bar similar to facebook that shows you names and pictures as you type into a search bar. e.g. typing jo would bring up a drop down of "John Smith" and "Michael Jordan". This works really well on the development server, and even works really well in production, when the user searches immediately after loading the page. If I wait on the page, say 30 seconds to a min. Then try and use the search bar, it takes a very long time to show the results. Sometimes as long as 15 seconds, when it used to be immediate. Can someone explain what is going on here. Is there any way I can keep this request hot? My search bar implements the JQuery autocomplete bar and uses Jquery ajax gets to fetch the results. -- 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] Stop blob URL from expiring
I am uploading images to the blob store. I have copied the example from http://code.google.com/appengine/docs/java/blobstore/overview.html The only problem I encounter is: If I load the page with the form, and not immediately submit the image. The URL can expire and when I do try and load the image I get an error page. How can I check to see if the URL has expired and refresh the URL without the user knowing? -- 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 Query ordering issue
I think this is referring to the indexes needed to perform the query and not the sort orders needed. All you need to do is order only on score. As long as your indexes are updated your query should work fine. On May 26, 6:33 am, mscwd01 wrote: > The restriction I am referring to is mentioned > here:http://code.google.com/appengine/docs/java/datastore/jdo/queries.html > Scroll down to "Query Sort Orders" where it says: > > Due to the way the App Engine datastore executes queries, if a query > specifies inequality filters on a property and sort orders on other > properties, the property used with the inequality filters must be > ordered before the other properties. > > I'm not sure what you mean by "Entity query class"? > > On May 25, 2:15 pm, Brandon Donnelson wrote: > > > > > What restrictions are you referring? Have you tried the entity query class, > > the sort is a bit easier to set up. > > > Query q = new Query("BlobTmpJdo"); > > q.addFilter("key", FilterOperator.EQUAL, fbd.getKey()); > > q.addSort("index"); > > > Brandon Donnelsonhttp://gwt-examples.googlecode.com -- 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: Change where Deploy is built
I'm guessing this isn't possible? On May 17, 9:51 pm, WillSpecht wrote: > It seems that whenever I deploy, thebuildfiles are all being saved > to my local settigns/Temp folder. Is there a way tochangewhere > these files are saved? My C folder is very full and building to this > folder takes a long time. I think I could deploy much faster if these > files were written to the same folder the project is saved in or at > least the same drive. -- 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] Change where Deploy is built
It seems that whenever I deploy, the build files are all being saved to my local settigns/Temp folder. Is there a way to change where these files are saved? My C folder is very full and building to this folder takes a long time. I think I could deploy much faster if these files were written to the same folder the project is saved in or at least the same drive. -- 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] UserService
Does anyone have any good User Service code that doesn't use the Google API? We recently discovered that some people don't trust the google login api, enough so that it is a deal breaker for using our service. Before I write my own User Service, I was wondering if there is a good open option or if anyone can suggest an article that I should read before trying to do this. Security is probably my weakest domain (the reason i wanted to trust google with it in the first place) -- You received this message because you are subscribed to the Google Groups "Google App Engine for Java" group. To post to this group, send email to google-appengine-java@googlegroups.com. To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.
[appengine-java] How much cpu should a page use
I just installed appstats. I have been looking at the breakdown of a few of my pages. Some, pages where many different models are being displayed on one page, seem like they are making a lot of RPC's. Is there a good benchmark I should try and set my pages to? What are good numbers for RPC Total and Grand Total? Are there any patterns that help with displaying many different models on a single page? -- 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: Google checkout and GAE
Can someone explain why the SDK doesn't work on app engine. Does it use a library that's not on the white list? Is it just broken in general and doesn't work well anywhere? On Mar 22, 7:02 am, Tarun Jain wrote: > Hello Will, > > I am assuming you are using the Google Checkout integration java API. Though > I don't remember the exact details but I recall having run into similar > issues with Google Checkout when I was doing some work for > Exxtensions<https://www.exxential.com/exxtensions/home> and > it turned out that it was the JAXB context creation that accounted for > almost all the delay. So it is not really an issue with checkout being slow, > but the client library just isn't optimized. Ultimately, I had to move the > creation of the context to the static block apart from several other minor > changes here and there. > > Hope that helps. > > Tarun > > On Mon, Mar 21, 2011 at 10:34 PM, WillSpecht wrote: > > I am trying to integrate Google checkout with my GAE app. I am > > hitting 2 big bottle necks. exampleNotificationServelet is using a > > ton of CPU and usually fails with a time out if starting a new > > instance. I'm reading a few values from the merchant data and then > > doing one write to the data store. I don't see what can be taking > > that much time. > > > It is also taking forever to create a cart and redirect to the Google > > checkout page. It takes almost 15 seconds once pressing the checkout > > button. I have narrowed this down to the build and postCart methods. > > When I step through while debugging on my local host, these methods > > take about 10-12 seconds to complete. Is this normal? > > > I am having trouble debugging exampleNotificationServelet, since I > > don't know what checkout is sending to my server. Can anyone explain > > a good way to fake a notification to the localhost running > > exampleNotificationServelet? So I can set break points and see what is > > taking up so much CPU. > > > -- > > 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] Google checkout and GAE
I am trying to integrate Google checkout with my GAE app. I am hitting 2 big bottle necks. exampleNotificationServelet is using a ton of CPU and usually fails with a time out if starting a new instance. I'm reading a few values from the merchant data and then doing one write to the data store. I don't see what can be taking that much time. It is also taking forever to create a cart and redirect to the Google checkout page. It takes almost 15 seconds once pressing the checkout button. I have narrowed this down to the build and postCart methods. When I step through while debugging on my local host, these methods take about 10-12 seconds to complete. Is this normal? I am having trouble debugging exampleNotificationServelet, since I don't know what checkout is sending to my server. Can anyone explain a good way to fake a notification to the localhost running exampleNotificationServelet? So I can set break points and see what is taking up so much CPU. -- 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: Weird performance problem last 3 days or so
Has anyone tried deploying a different app to the slow appid then redploying the old app? On Mar 13, 11:20 am, Michael Green wrote: > Thanks for the tip! I've confirmed the exact same behavior. I deployed the > same application to a new appspot domain and it seems to be running much > faster. My problem is that I've set up a Google App domain for the > first. So before going through the headache to switch to a new domain, i'd > be interested in investigating what is happening. -- 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: Best way to delete items
I guess I don't understand your solution. I would still need an indexed query to search for the child entities. What is the point of creating a child entity? How does it stop me from needing an indexed search? On Mar 1, 3:59 pm, Ben wrote: > Hi Will, > > Could you create a child Entity that only has a deleted field, then if > it's true return the parent? > > -Ben > > http://www.liink.ithttp://about.me/benjamincOn Tue, Mar 1, 2011 at 2:56 PM, > WillSpecht wrote: > > I want to allows users to delete entities but not actually delete > > them. Usually I would just create a field, deleted, and set it to > > true when the user chooses to delete it. Then to show these records i > > just use owner == userId && deleted ==false. But this forces me to > > use an index for every query I run. It seems I will very quickly be > > using up indexes. > > > My other solution is to create a new entity deletedItem and store > > deleted Items in an entity that corresponds to it. deleted foo's > > would be stored in deletedFoo... This solution also seems to have > > major drawbacks. > > > What is the recommended way to do stored deletes on 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-java@googlegroups.com. > > To unsubscribe from this group, send email to > > google-appengine-java+unsubscr...@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-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] Best way to delete items
I want to allows users to delete entities but not actually delete them. Usually I would just create a field, deleted, and set it to true when the user chooses to delete it. Then to show these records i just use owner == userId && deleted ==false. But this forces me to use an index for every query I run. It seems I will very quickly be using up indexes. My other solution is to create a new entity deletedItem and store deleted Items in an entity that corresponds to it. deleted foo's would be stored in deletedFoo... This solution also seems to have major drawbacks. What is the recommended way to do stored deletes on 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-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: Probably a newbie question (most likely)
Check out this blog post: http://gae-java-persistence.blogspot.com/2009/10/creating-bidrectional-owned-one-to-many.html I'm pretty sure you want to be persisting the thread and not the comment. If you make it un-owned, you want the thread to have a key and a user, then each comment has a key and a parent key which is the key of the thread it belongs to. if you do a query where parent key == thread key you should get all the comments that belong to the thread. On Feb 22, 7:06 pm, "Fernando O." wrote: > tried that and it's telling me > org.datanucleus.exceptions.NucleusObjectNotFoundException: Could not > retrieve entity of kind Thread with key Thread(51) > > I also tried doing a query with the Thread key and UserKey (wich is the key > for a thread) and then I get an exception about modifying 2 entities in 1 > transaction :S > > On Tue, Feb 22, 2011 at 8:56 PM, Fernando O. wrote: > > Thanks! I'll try that. BTW no, addComment does not store the comment. > > > On Tue, Feb 22, 2011 at 8:49 PM, WillSpecht wrote: > > >> Don't you need to persist the thread as well as the comment? It's > >> hard to analyze your code with such a small sample. Does addComment > >> persist the thread? My > >> guess is that something is making the transaction fail, probably > >> cause you are trying to operate on two different entity groups. I > >> would simply store the comment as it's own entity and when you want > >> all the comments simply do a query for comments with parentKey == > >> ThreadKey. > > >> On Feb 21, 9:30 pm, "Fernando O." wrote: > >> > Hi all. > >> > First of all I have to admit: I havent read all the docs. > > >> > I had a small app running, it basically has this: > >> > A User: > >> > @PersistenceCapable(detachable = "true") > >> > @FetchGroup(name = "_post", members = { @Persistent(name = "posts") }) > >> > public class User implements Serializable{ > >> > @PrimaryKey > >> > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > >> > private Key key; > >> >> @Persistent(mappedBy = "user", defaultFetchGroup = "true") > >> > @Element(dependent = "true") > >> > private List posts; > >> > } > > >> > A thread : > > >> > @PersistenceCapable(detachable = "true") > >> > @FetchGroup(name = "_user", members = { @Persistent(name = "user")}) > >> > public class Thread implements Serializable { > >> > @PrimaryKey > >> > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > >> > private Long key; > > >> > @Persistent(defaultFetchGroup = "true") > >> > @Element(dependent = "true") > >> > private User user; > >> > ... > > >> > } > > >> > So now I want to add comments, each comment will have: the user that > >> made > >> > the comment, and the thread that it belongs to, and some other fields: > >> > @PersistenceCapable(detachable = "true") > >> > public class ThreadComment implements Serializable{ > >> > @PrimaryKey > >> > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > >> > private Key key; > > >> > @Persistent(defaultFetchGroup = "true") > >> > @Element(dependent = "true") > >> > private User user; > > >> > @Persistent(defaultFetchGroup = "true") > >> > @Element(dependent = "true") > >> > private Thread thread; > >> > ... > > >> > } > > >> > I changed the Thread to include a list of comments: > >> > @PersistenceCapable(detachable = "true") > >> > @FetchGroup(name = "_user", members = { @Persistent(name = > >> > "comments"),@Persistent(name > >> > = "user")}) > >> > public class Thread implements Serializable { > >> > > >> > @Persistent(defaultFetchGroup = "true") > >> > @Element(dependent = "true") > >> > private List comments; > > >> > } > > >> > My problem is that meanwhile this works in memory when I try to persist > >> the > >> > ThreadComment > >> > PersistenceManager pm = getPMF(); > >> > Transaction tx = pm.currentTransaction(); > >> > tx.begin(); &
[appengine-java] Re: Probably a newbie question (most likely)
Don't you need to persist the thread as well as the comment? It's hard to analyze your code with such a small sample. Does addComment persist the thread? My guess is that something is making the transaction fail, probably cause you are trying to operate on two different entity groups. I would simply store the comment as it's own entity and when you want all the comments simply do a query for comments with parentKey == ThreadKey. On Feb 21, 9:30 pm, "Fernando O." wrote: > Hi all. > First of all I have to admit: I havent read all the docs. > > I had a small app running, it basically has this: > A User: > @PersistenceCapable(detachable = "true") > @FetchGroup(name = "_post", members = { @Persistent(name = "posts") }) > public class User implements Serializable{ > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Key key; > > @Persistent(mappedBy = "user", defaultFetchGroup = "true") > @Element(dependent = "true") > private List posts; > } > > A thread : > > @PersistenceCapable(detachable = "true") > @FetchGroup(name = "_user", members = { @Persistent(name = "user")}) > public class Thread implements Serializable { > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Long key; > > @Persistent(defaultFetchGroup = "true") > @Element(dependent = "true") > private User user; > ... > > } > > So now I want to add comments, each comment will have: the user that made > the comment, and the thread that it belongs to, and some other fields: > @PersistenceCapable(detachable = "true") > public class ThreadComment implements Serializable{ > @PrimaryKey > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > private Key key; > > @Persistent(defaultFetchGroup = "true") > @Element(dependent = "true") > private User user; > > @Persistent(defaultFetchGroup = "true") > @Element(dependent = "true") > private Thread thread; > ... > > } > > I changed the Thread to include a list of comments: > @PersistenceCapable(detachable = "true") > @FetchGroup(name = "_user", members = { @Persistent(name = > "comments"),@Persistent(name > = "user")}) > public class Thread implements Serializable { > > @Persistent(defaultFetchGroup = "true") > @Element(dependent = "true") > private List comments; > > } > > My problem is that meanwhile this works in memory when I try to persist the > ThreadComment > PersistenceManager pm = getPMF(); > Transaction tx = pm.currentTransaction(); > tx.begin(); > thread.addComment(comment); > pm.makePersistent(comment); > tx.commit(); > pm.close(); > > the code gets excecuted but I don't see the comment in the database (in fact > the logs show no db activity either) > So I don't see an exception, the code gets excecuted but I don't see the > comment in the DB. > > I already have the db with soem threads without comments, this is a "new > feature" > > Any idea of what I'm doing wrong? (please don't say everything :D ) > > Thanks! > > Fernando -- 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: Help With Data Modeling (And Performance Questions)
I think you should ask yourself what data you need from the user. I know this might not seem like the best way(in a RDBM), but you might want to store the information from the user, in the clip. Especially if it is information that doesn't change very often like user name. That way you have the information each time you load the clip and don't even have to run those expensive queries. The added work is that when a user changes their user name, you need to update a bunch of records, but you can do that in a task queue and it probably doesn't happen nearly as often as looking at a list of clips does . On Feb 11, 1:48 pm, Tony Chuinard wrote: > My project consists of thousands of audio clips, each submitted by a user > (kind of like YouTube). > > Currently, the Clip entity is as follows > > // > private long userId; > > So userId is the id of the person who made that clip. Since I want to load > the User object when I load a record, I take my list of recordings (never > above 20) and do something like this: > > SELECT FROM User s WHERE s.id = userIdOfFirst OR s.id = userIdOfSecond > OR. > > This works, and I create a Map which now allows me to lookup > users by ID in my app when displaying data to the user, but is this the most > efficient way of doing it? I was looking at storing a private Key user, > because I know I can't do private User user, but I don't know if replacing > it with Keys would be a lot more efficient since that long is just a key. > > So does that big OR query have any performance implications? Would I be > better off doing something like: > List relevantUsers = new LinkedList(); > for (Clip clip : allMyClips) { > relevantUsers.add(em.load(clip.getUserId())); > > } > > Using the em.load should be really quick because right now the long IS the > key. > > Can someone just fill in these gaps for me on my confusion? -- 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: Reposting question on jsp include.
Each page is pre-compiled for the live app. On the development server pages are compiled on the fly. This means that you have to pass your variables as parameters or attributes. I believe the best design pattern is to have a servlet catch your page request, create all the variables you need to display the view, then forward the page to the view with the variables stored as request attributes. I would like someone to confirm this pattern because I am also unsure if this is the "proper" way to handle this. On Feb 8, 1:38 am, Charms Styler wrote: > Hi rdayal, would appreciate a lot your response on this since no actual > answer was found out anywhere. > > could you pls explain why the included page cannot access variables of the > parent page on deployment ? because in dev server it works!!! > but while uploading the app it throws on jsp > > "cannot find symbol [javac] symbol : variable name" > > Overall a nasty error as fallows.. > > unable to update: > com.google.appengine.tools.admin.JspCompilationException: Failed to compile > jsp files. > at > com.google.appengine.tools.admin.Application.compileJsps(Application.java:413) > at > com.google.appengine.tools.admin.Application.createStagingDirectory(Application.java:291) > at > com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java:54) > at > com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java:271) > at > com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java:146) > at > org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38) > at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) -- 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: hard time modeling my database
So you are worried that a user will be deleted and his key will still be linked to the book? You can't rely on the database to do that work for you. You can do this two ways, worry about it, and when you delete a user, make sure you delete it's key from every book. Or don't worry about it. If you do your queries right, having a non existent user stored in a book won't cause any problems. But I would recommend removing it when a user gets deleted. On Feb 7, 3:11 pm, Arjan wrote: > Will, > Thanks for the hint. > When i use the User key (a String) as the reference from the Book to the > User object, that would mean that the referential integrity is not enforced > by the database. I understand that it would work, but it feels kind of > strange. > Is there a way to maintain the referential integrity on between the classes? > Regards. -- 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: hard time modeling my database
You want to store the Key of the User not the actual User. If you store the User you are creating an owned relationship. This means that the user can only be owned by one book. What you want is an unowned relationship, which means storing the keys. Then your query stays the same except you will need to add query.import("import Key") <--- not the exact syntax On Feb 6, 5:04 pm, Arjan wrote: > Hi all, > It seems like i am doing this the wrong way and the datastore is giving me a > hard time making queries. > I've got a my own User class in my application and there is a Book class in > the application. > Now the Book class has an owner and a write attribute. > @Entity > class User { > @Id > private String email; > > } > > @Entity > class Book { > @Id > @GeneratedValue(strategy = GenerationType.IDENTITY) > private Key key; > private User owner; > private User writer; > > } > > I want to search the store for all owned books (on the users myPage) > Query query = getEntityManager().createQuery("SELECT b FROM Book b WHERE > b.owner == :owner"); > query.setParameter("owner", owner); > > List books = query.getResultList(); > > Now the datastore is throwing ugly things to me like "Key of parameter value > does not have a parent." > > I'm realy lost here. Could anyone explain to me how i could solve 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: Just getting started with Datastore
Can you elaborate on pulling a Bing. On Feb 2, 4:01 pm, "Ikai Lan (Google)" wrote: > Yep, entities are schemaless. This is both powerful and a bit of a mismatch > to Java's type system. We've all become very used to thinking in terms of > types. A little too much sometimes, in my opinion. > > Objectify's documentation is really amazing. I've been considering pulling a > Bing and copy-pasting his intro into our official docs. > > -- > 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, Feb 2, 2011 at 9:59 AM, David Sowerby wrote: > > > Matt > > > No problem - I think most of us have been there! > > > On Feb 2, 3:17 am, Matt Reeves wrote: > > > Thanks David (and thanks all), that is a good intro. I think the light > > bulb > > > just went off in my head that there is no requirement that you define how > > an > > > Entity and its properties should look. Two entities can be of the same > > kind > > > but look completely different (which would likely be pointless to have > > any > > > useful queries). I was just having a hard time unlocking my brain from > > the > > > relational db world... all the explanation was spelled out right in front > > of > > > me, just took a few nights to sink in. > > > > Thanks again. > > > -- > > 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: pass parameters through login service
I am using the Google authorization services with . How do I specify the successURL. It seems to automatically pass the URL the user was trying to access before needing to log in, only it cuts off all the parameters. Do I need a filter of some kind that is run before each request and saves parameters? On Jan 29, 6:38 pm, Ben Carlson wrote: > You should pick up any parameters passed to the page, send them to the login > page, and then use that as the successURL for a successful login. > > -Ben > > Sent from my iPhone > > On Jan 29, 2011, at 5:06 PM, WillSpecht wrote: > > > I recently made it so most of my pages require a user to be logged in > > to view. The only problem I'm having is, if a user tries to come > > directly from a link > > > myapp.appspot.com/page.jsp?pageId=aoSCuanjFAVoasDmNlkadf > > > they are asked to login, then forwarded to myapp.appspot.com/page.jsp > > > How do I make it so they are forwarded to myapp.appspot.com/page.jsp? > > pageId=aoSCuanjFAVoasDmNlkadf > > > Is this possible? > > > Should I not be showing users addresses like myapp.appspot.com/ > > page.jsp?pageId=aoSCuanjFAVoasDmNlkadf > > > -- > > 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 > > 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-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] pass parameters through login service
I recently made it so most of my pages require a user to be logged in to view. The only problem I'm having is, if a user tries to come directly from a link myapp.appspot.com/page.jsp?pageId=aoSCuanjFAVoasDmNlkadf they are asked to login, then forwarded to myapp.appspot.com/page.jsp How do I make it so they are forwarded to myapp.appspot.com/page.jsp? pageId=aoSCuanjFAVoasDmNlkadf Is this possible? Should I not be showing users addresses like myapp.appspot.com/ page.jsp?pageId=aoSCuanjFAVoasDmNlkadf -- 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: Blobstore upload loading bar
I made a few changes to this tutorial(http://www.cssjockey.com/web- development/an-easy-way-to-create-loading-bar). It doesn't really show how much progress the load has made but at least users will know something is hapening. When the page loads I call $("loading").hide(); then right after I call $("blob-form").submit(); I added $("blob-form").hide(); $("loading").show(); man I love jQuery! On Jan 25, 8:34 am, Didier Durand wrote: > Hi, > > To my knowledge it is impossible based on infos provided by GAE: the > blobstore will call your servlet once only at the very end of the > upload process. > > So, no hope from back-end perspective but maybe possible from a front- > end perpective it the client can detect and feed the loading bar with > how many bytes already accepted by the server. > > Don't know enough about front-ends to propose a solution. Anybody ? > > regards > > didier > > On Jan 25, 1:34 pm, WillSpecht wrote: > > > What would be the best way to implement a loading bar for a blob store > > upload. Right now I click submit and the page freezes while the file > > is uploaded. Is there a way to create a loading bar on screen so the > > user knows the file is loading and doesn't try to refresh or navigate > > to another page and not upload the 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-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] Blobstore upload loading bar
What would be the best way to implement a loading bar for a blob store upload. Right now I click submit and the page freezes while the file is uploaded. Is there a way to create a loading bar on screen so the user knows the file is loading and doesn't try to refresh or navigate to another page and not upload the 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-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: Amazon widget not showing on PC's
I'm sorry, I guess this was a little off topic, but I am hosting this on google app engine. So I thought maybe there was something about cross site scripting that acted weird on app engine. I later found out that my problem was an ad blocker on the machine I was testing on. Guess I should have made it more clear that I was using app engine. Thanks for pointing this out with a useless message, and allowing me to write another useless post to follow up on your initial uselessness. On Jan 21, 11:55 pm, jp wrote: > Dear WillSpecht, this forum is for people to discuss issues with > Google App Engine for Java. Please take your totally unrelated issue > elsewhere. -- 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: Struggling w/datastore relationship
from http://code.google.com/appengine/docs/java/datastore/queries.html It looks like the syntax is Query q = new Query(TAG.class); q.addFilter("urlId == urlParam"); q.addFilter("userId == userParam"); On Jan 21, 4:13 pm, WillSpecht wrote: > The first syntax should be: > > query.setFilter("urlId == urlParam"); > query.setFilter("userId == userParam"); > > On Jan 21, 12:36 am, WillSpecht wrote: > > > So you want to be able to find all URL's saved by a User that have a > > certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or, > > all the Tags given a URL by a certain User? > > > This can be done with our Model. It's actually what the second part > > of the video in the link is about. > > > Merge Join > > > All you need to do is add a second filter. > > > not sure if the syntax is: > > > query.setFilter("urlId == urlParam"); > > > or > > > query.setFilter("urlId == urlParam && userId == userParam"); > > > This query would return all the Tags that a specific User put on a > > specific URL. > > > I hope this is what you were looking for. > > > On Jan 20, 5:39 pm, Benjamin Carlson wrote: > > > > I just came across this document: > > > >http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of... > > > > It helps, but doesn't completely answer my question. It would appear that > > > what I'm wanting to do is an EAV (entities/attributes/values) type > > > relationship, however, I'm still not clear on how to do so in GAE/J and > > > still be able to query how I need to. > > > > As for adding a list to each of User and Tag, it doesn't keep the > > > relationship between the User, Tag AND URL... just two of the three... > > > that's what's causing me heartburn here... :) Or, perhaps it does, and I'm > > > too relationally-minded to see it? > > > > Thanks! > > > > -Ben -- 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: Struggling w/datastore relationship
The first syntax should be: query.setFilter("urlId == urlParam"); query.setFilter("userId == userParam"); On Jan 21, 12:36 am, WillSpecht wrote: > So you want to be able to find all URL's saved by a User that have a > certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or, > all the Tags given a URL by a certain User? > > This can be done with our Model. It's actually what the second part > of the video in the link is about. > > Merge Join > > All you need to do is add a second filter. > > not sure if the syntax is: > > query.setFilter("urlId == urlParam"); > > or > > query.setFilter("urlId == urlParam && userId == userParam"); > > This query would return all the Tags that a specific User put on a > specific URL. > > I hope this is what you were looking for. > > On Jan 20, 5:39 pm, Benjamin Carlson wrote: > > > I just came across this document: > > >http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of... > > > It helps, but doesn't completely answer my question. It would appear that > > what I'm wanting to do is an EAV (entities/attributes/values) type > > relationship, however, I'm still not clear on how to do so in GAE/J and > > still be able to query how I need to. > > > As for adding a list to each of User and Tag, it doesn't keep the > > relationship between the User, Tag AND URL... just two of the three... > > that's what's causing me heartburn here... :) Or, perhaps it does, and I'm > > too relationally-minded to see it? > > > Thanks! > > > -Ben -- 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: Struggling w/datastore relationship
So you want to be able to find all URL's saved by a User that have a certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or, all the Tags given a URL by a certain User? This can be done with our Model. It's actually what the second part of the video in the link is about. Merge Join All you need to do is add a second filter. not sure if the syntax is: query.setFilter("urlId == urlParam"); or query.setFilter("urlId == urlParam && userId == userParam"); This query would return all the Tags that a specific User put on a specific URL. I hope this is what you were looking for. On Jan 20, 5:39 pm, Benjamin Carlson wrote: > I just came across this document: > > http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of... > > It helps, but doesn't completely answer my question. It would appear that > what I'm wanting to do is an EAV (entities/attributes/values) type > relationship, however, I'm still not clear on how to do so in GAE/J and > still be able to query how I need to. > > As for adding a list to each of User and Tag, it doesn't keep the > relationship between the User, Tag AND URL... just two of the three... > that's what's causing me heartburn here... :) Or, perhaps it does, and I'm > too relationally-minded to see it? > > Thanks! > > -Ben -- 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: Struggling w/datastore relationship
Just add a Tags list to User and a User list to Tag. This way you can search for Users with a given tag or Tags that has been used by a given user. Its still the same structure you just add another set of lists. If you do this, you will be able to quickly process each query you listed in your original post. If you are still looking to do more, another possible query that you wouldn't be able to do with this structure would be helpful. I'm not totally sure about the upper limit of the index, I've never had a system that approached them. On Jan 19, 4:39 pm, Benjamin Carlson wrote: > Thanks much for the link! It doesn't directly answer my issue, but it did > give me a few more ideas about how to go about this... I've watched it three > times (so far)! :) > > Despite seeing the merge-join in action, I don't think it quite matches my > model, so I'm trying to visualize how to make my data match one of these > models... and that's not working so far either. Anyone else have ideas? The > issue that isn't addressed is the third relationship... everything > demonstrated and talked about in these slides only discuss two > relationships, and it doesn't appear that a third would work (or at least > not very well!). > > Also, the limit _is_ over 2000, but sounds like it's 5000 per index. The > extended index class is pretty interesting, but I'm not completely > understanding that either... does that mean I create a new instance of the > index class each time I reach 5000 entries? Or does it mean I create a new > index class itself (i.e. three instances of userIndexClass or one instance > of each of userIndexClassOne, userIndexClassTwo and userIndexClassThree)? > > Thanks again! > > -Ben -- 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: Struggling w/datastore relationship
This is not the way that I would do it. First, this is the JAVA app engine group that code looks like python as is the link you referenced. The way I have found in app engine to be able to make the fastest queries is to use lists of keys in each object to manage relationships. so your model would look like this. USER has a list of URL's and a URL has a list of USER's This way you can find all the URL's of a user by Query query = pm.newQuery(URL.class); query.setFilter("userId == userParam"); query.declareParameters("Key userParam"); query.declareImport("import com.google.appengine.api.datastore.Key" ); List myURLs = (List) query.execute(userId); Or find all the USER's that hold a URL Query query = pm.newQuery(USER.class); query.setFilter("urlId == urlParam"); query.declareParameters("Key urlParam"); query.declareImport("import com.google.appengine.api.datastore.Key" ); List urlUsers = (List) query.execute(urlId); I usually put this in a static function in my class public static USER getUserFromURL(urlId) Same goes for URL's and TAG's What then do you have to worry about. When a user removes a URL you have to remove it from the USER and the URL. This means more work when a change happens but reads happen much more often than writes(a mind set you need to accept to work on app engine) so we optimize for the reads not the writes. Watch this google IO lecture to see even more about this including ways to handle your user having 2000+ URL's http://www.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html If you have any other questions, feel free to ask. On Jan 18, 6:57 am, Ben Carlson wrote: > Hello, I'm writing a replacement for del.icio.us on GAE, and am really > struggling with what the right way to do the User / URL / Tag > relationship: > > Here's what I'm referencing for my idea: > > http://code.google.com/appengine/articles/modeling.html > > My thought is to have three Entity's: > > User > URL > Tag > > Then use a relationship model for the inter-relationships: > > class UserURLTags(db.Model): > userURLs = db.ReferenceProperty(User, > required=True, > collection_name='urls') > userTags = db.ReferenceProperty(User, > required=True, > collection_name='tags') > urlUsers = db.ReferenceProperty(URL, > required=True, > collection_name='users') > urlTags = db.ReferenceProperty(URL, > required=True, > collection_name='tags') > tagUsers = db.ReferenceProperty(Tag, > required=True, > collection_name='users') > tagURLs = db.ReferenceProperty(Tag, > required=True, > collection_name='urls') > > The idea behind this is to allow lookups for each of the following: > > User's URLs (get all of user xyz's URLs) > User's Tags > > URL's Tags (get all of the tags for URL 'abc') > URL's Users > > Tag's URLs (get all of the URLs tagged with 'efg') > Tag's Users > > Is this just a terrible mis-understanding of the proper way of doing > this association? > > Thanks in advance! > > -Ben -- 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: basic understanding of PersistenceManger
You can look at the local datastore at localhost:/_ah/admin Also if you are storing things in an arraylist you should be using pm.makePersistentAll(gcalendar). This is because this is only one api call instead of how ever many objects are in your arraylist, plus its less code. to erase entries you can use the datastore viewer or delete the local datastore which is descrbed well in this answer on stackoverflow http://stackoverflow.com/questions/1062540/how-to-delete-all-datastore-in-google-app-engine/1062553#1062553 On Jan 15, 3:05 am, soujiro0725 wrote: > Hi I'm a newbie in App Engine. > Right now, I am trying to develop an application myself, but my basic > understanding is weak. So someone, please clarify my knowledge. > > The question is HOW to store the data and to know what is stored. > > Say, I have my own class like, > > GCalendar(String date, String day, String time, String content) > > The variable "date" can be either a Date object or simply a String > object as long as the information (such as "2010/12/14") can be stored > and retrieved. > > Since an instance of this class represents one event, I want an array > of this class like, > > Listgcalendar = new ArrayList(); > > After obtaining data, I want to store them into Bigtable, so > > //- > PersistenceManager pm = PMF.get().getPersistenceManager(); > for (int j = 0; j < gcalendar.size(); j++){ > try { > pm = PMF.get().getPersistenceManager(); > pm.makePersistent(gcalendar.get(j)); > } finally { > pm.close(); > }} > > //- > Is this enough? > > The reason I'm asking is that I have no idea what is being stored as > the instance, namely "pm". > GCalendar object, maybe? > > Once the program is executed, it seems like some data is stored, even > if a part of it produces errors. > > How can I erase the entire data in order to start from scratch? > > If I can find out what is now stored with PersistenceManager, it seems > easier to continue fixing errors. > > soujirou -- 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] Persisting an empty set
I am trying to persist an empty HashSet in App Engine. It persists fine but when I pull the the item that contains the HashSet from the data-store the HashSet is now null. What can I do to force App Engine to store an empty HashSet? Or, do I just need to check for null and create the HashSet each time until it has something in it? I'm guessing I would create a field hashSetEmpty and not create the HashSet till I ran code that added to the HashSet. -- 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: Entity relationship designing - best practice
http://www.google.com/events/io/2009/sessions/BuildingScalableComplexApps.html this is a pretty good discussion on building apps that have lots of child objects. I also think you are prematurely optimizing. How many exams is a user going to have? 100, 200? This is still a tiny number and if you went with RB's method or the one in the link I posted, you have to run a separate query each time, which has its own costs. I think either way is fine until you start having users that have thousands of exams. On Dec 21, 3:05 am, Richard Berger wrote: > Har_Shan: > > I have been thinking about this topic also (but sadly, am not much of > an expert). I am using Objectify as a layer on top of the Datastore. > Their website has a lot of good information on structuring data in the > Datastore - seehttp://code.google.com/p/objectify-appengine/wiki/Concepts?tm=6 > ). > > There is also a good post on the various ways of handling 1 to many > relationships using Objectify. What appeared to be something that > would work in your situation (which is like my situation) is what I > think of as the "database approach". What I mean by that is, if you > had a 1 to many relationship, how would you model that in a database? > Specifically if 1 User can have Many Exams, you would have... > > User table > * userId > * Other user fields > > Exam table > * examId > * userId > * Other exam fields > > So, turning this into GWT/Objectify, it would be > > public class User { > @Id private Long id; > // Other user fields > > } > > public class Exam{ > @Id private Long id; > private Key userKey; > // Other exam fields > > } > > The way to find all the exams for a particular user (represented by > "this") is: > Objectify ofy = ObjectifyService.begin(); > Key userKey = new Key(User.class, this.id); > List result = ofy.query(Exam.class).filter("userKey", > userKey).list(); > > This is explained (much better than I could do) > at:http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjec... > > This may not solve all (or any) of your use cases, but it has worked > for me in my admittedly very limited usage. > Also check > out:http://groups.google.com/group/objectify-appengine/browse_frm/thread/... > > Enjoy, > RB > > On Dec 19, 12:17 am, Matej wrote: > > > I am not expert in dataStore this is just what I would do: > > Add new entity with fields: > > ID OrderID UserID ExamID PageID QuestionID AnswerID > > > Yes it is a lot of redundant data, but simple. > > When user starts new Exam, all data are created with AnswerID set to > > general answer unAnswer. After that you just update AnswerID. > > > What are obstacle in design like this? > > > Best, 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-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: storing unowned objects(one to many) in datastore
Why do you want to store both in the same transaction? To me, it seems transactions are used to guarantee two things happen. eg. you don't want to delete one record without making sure the a log of deleted records is updated. Transactions are also used to prevent collisions, eg. I don't want two users adding to a counter at the same time and one of their adds is lost. It seems neither of these is likely. It is unlikely that a new Person will be created and before the system can save their mobile, some other user will try and edit it. It is also unlikely that either of these will fail and not fail gracefully. If you try and add a user in one transaction then try to add a mobile in a second transaction either both will succeed or fail. Same outcome as a single transaction. Or one of the two fails and you simply try it again or delete the one that didn't fail and inform the user. If you really need a single transaction you can put both items in the same entity group using a key builder. You can see an example here under Creating Entities With Entity Groups http://code.google.com/appengine/docs/java/datastore/transactions.html Dec 15, 10:16 pm, Didier Durand wrote: > Hi, > > If they don't belong to the same entity group, you will raise an > exception by trying to store 2 objects in a single transaction. > > 2 ways to handle that: > > a) you make Mobile belong to same entity group as Person so you'll > be able to store both in a single transaction. I understand in your > question that you can't go this way. > b) you store one let's say Person in first transaction and during > this transaction, you start a task as part of the transaction: "You > can enqueue a task as part of a datastore transaction, such that the > task is only enqueued—and guaranteed to be enqueued—if the transaction > is committed successfully. Tasks added within a transaction are > considered to be a part of it and have the same level of isolation and > consistency." as said > inhttp://code.google.com/appengine/docs/java/taskqueue/overview.html#Ta... > > Hope it helps > > didier > > On Dec 15, 8:26 am, kartik kudada wrote: > > > Can we store two unowned objects(one to many) in datastore in a single > > transaction. > > For example - We have > > > public class Person { > > @PrimaryKey > > �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Long id; > > > @Persistent > > private String name; > > > @Persistent > > private List mobileIds = new ArrayList(); > > > // > > //. > > } > > > public class Mobile { > > > �...@primarykey > > @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) > > private Key mobileId; > > > // ... > > // > > > } > > > I want to store these two objects in datastore in single transaction so that > > relation can be made in between both objects. > > Tell me if any other solution is there ? -- 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] Why can't i persist a BitSet
I am trying to store a BitSet to my data store but when I try to use it I get the following error: java.lang.IllegalArgumentException: thisRuleSet: java.util.BitSet is not a supported property type. Can I not store a BitSet even though it is serializable and if I can't, what is the suggested work around? -- 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] JTidy
I am trying to use JTidy in Eclipse. I add JTidy jar to the build path and add the jar again as the source attachment. When I make a tidy object it shows up as a org.w3c.tidy.Tidy. but when I run my app i get the error java.lang.NoClassDefFoundError: org/w3c/tidy/Tidy. Am I not adding the jar correctly? Does JTidy not work on google 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.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...?
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 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 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 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: Do I need unowned relationships to accomplish this...?
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 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] Unable to upload app: Error posting to URL:
I am getting the following error when trying to upload my app to app engine. What does the 302 Redirected mean? I am behind a proxy could this be part of the problem? Error Tue Mar 09 11:12:47 EST 2010 Unable to upload app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=black3live&version=1&302 Redirected See the deployment console for more details com.google.appengine.tools.admin.AdminException: Unable to upload app: Error posting to URL: http://appengine.google.com/api/appversion/create?app_id=black3live&version=1&; 302 Redirected at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 59) at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy(AppEngineBridgeImpl.java: 271) at com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace(DeployProjectJob.java: 148) 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: http://appengine.google.com/api/appversion/create?app_id=black3live&version=1&; 302 Redirected at com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java: 143) at com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java: 81) at com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java: 415) at com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java: 229) at com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java: 98) at com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: 53) -- 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: problem while deploying app engine
Try this thread about setting up eclipse to handle a proxy: http://www.google.com/url?sa=D&q=http://groups.google.com/group/google-appengine-java/browse_thread/thread/83baef734bc82d7a/&usg=AFQjCNG4ECLL89uyiz16HQyCh7dNx9Rr7w On Feb 16, 7:18 am, vengatesh wrote: > Hi, > > I just started using GWT and I am trying todeploymy firstapponapp > engine.. > > I am getting the following error while doing "DeploytoAppEngine"... > > Unable to updateapp: Connection timed out: connect > com.google.appengine.tools.admin.AdminException: Unable to updateapp: > Connection timed out: connect > 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: > 148) > 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.net.ConnectException: Connection timed out: connect > at java.net.PlainSocketImpl.socketConnect(Native Method) > at java.net.PlainSocketImpl.doConnect(Unknown Source) > at java.net.PlainSocketImpl.connectToAddress(Unknown Source) > at java.net.PlainSocketImpl.connect(Unknown Source) > at java.net.SocksSocketImpl.connect(Unknown Source) > at java.net.Socket.connect(Unknown Source) > at com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source) > at com.sun.net.ssl.internal.ssl.BaseSSLSocketImpl.connect(Unknown > Source) > at sun.net.NetworkClient.doConnect(Unknown Source) > at sun.net.www.http.HttpClient.openServer(UnknownSource) > at sun.net.www.http.HttpClient.openServer(UnknownSource) > at sun.net.www.protocol.https.HttpsClient.(Unknown Source) > at sun.net.www.protocol.https.HttpsClient.New(UnknownSource) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClien... > Source) > at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown > Source) > at > sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown > Source) > at > sun.net.www.protocol.http.HttpURLConnection.getOutputStream(Unknown > Source) > at > sun.net.www.protocol.https.HttpsURLConnectionImpl.getOutputStream(Unknown > Source) > at > com.google.appengine.tools.admin.ServerConnection.connect(ServerConnection.java: > 338) > at > com.google.appengine.tools.admin.ServerConnection.send(ServerConnection.java: > 133) > at > com.google.appengine.tools.admin.ServerConnection.post(ServerConnection.java: > 82) > at > com.google.appengine.tools.admin.AppVersionUpload.send(AppVersionUpload.java: > 532) > at > com.google.appengine.tools.admin.AppVersionUpload.beginTransaction(AppVersionUpload.java: > 349) > at > com.google.appengine.tools.admin.AppVersionUpload.doUpload(AppVersionUpload.java: > 111) > at > com.google.appengine.tools.admin.AppAdminImpl.update(AppAdminImpl.java: > 56) > ... 4 more > > any help would be highly appreciated.. > > 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.com. For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en.