[appengine-java] Re: can't update the same entity twice in a transaction or operation RAISED ONLY in JUnit tests

2009-09-25 Thread Marton Papp
correctly in the GAE development server. I'll send you the code ASAP. Thanks Marton Papp wrote:Hi Patrizio, I am not sure what you mean by having the error only in JUnit tests. The same code runs correctly in some other environment? Anyway, the documentation says that it is not allowed

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-24 Thread Marton Papp
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

[appengine-java] Re: can't update the same entity twice in a transaction or operation RAISED ONLY in JUnit tests

2009-09-24 Thread Marton Papp
Hi Patrizio, I am not sure what you mean by having the error only in JUnit tests. The same code runs correctly in some other environment? Anyway, the documentation says that it is not allowed to update the same entity more than once in a single transaction. However I was not able to reproduce

[appengine-java] Re: Seeing different (incorrect?) JDO behavior after upgrading to 1.2.5

2009-09-24 Thread Marton Papp
Hi Patrizio, I removed the _embedded=true_ attribute from the mapping of the stat field and now it seems to be better. At least I can retrieve the object with the correct values. I have not checked the code in detail, but I guess if you are embedding Stat then you do not need a primary key for

[appengine-java] Re: Best practice for modeling relationships (Java, Datastore) - list of keys or list of actual objects?!

2009-09-24 Thread Marton Papp
Hi, I think that the performance of ListPicture can actually be better then using ListKey. Of course you should not try to retrieve the pictures by using user.getPictures() if there are many, because it will try to load all of them. But the difference is how it is stored in the database. I think

[appengine-java] Re: Exception when using gae.parent-pk; string cannot be converted into a Key

2009-09-24 Thread Marton Papp
Hi Andreas, The field mapped with the gae.parent-pk is expected to hold a Key value or a key value encoded as string. Try this: public ShoppingList(Shopper shopper) { Key shopperKey = KeyFactory.createKey(Shopper.class.getSimpleName(), shopper.getEmail());

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-22 Thread Marton Papp
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

[appengine-java] Re: JDO vs low level API

2009-09-21 Thread Marton Papp
Hi Corneliu! I also had doubts about using JDO in GAE when I started to work with it. Especially because I met several bugs and it was annoying and time wasting to figure out what was going wrong. But then the bugs were fixed in the next release, so I think the guys are generally doing a good

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-21 Thread Marton Papp
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

[appengine-java] Re: Retrieve of Collection model not working

2009-09-21 Thread Marton Papp
Hi, Those two are equivalent Java constructs, and it should not be the solution to your problem. Have you tried rewriting your code to the original (having the return statement within the try block) and run it again? Are you sure you have not changed anything else? Marton On Sep 21, 6:29 pm,

[appengine-java] Re: Query a collection of entities with their IDs

2009-09-21 Thread Marton Papp
Hi Max, I am surprised that this actually works. :) I could not find the documentation describing this feature. Do you know how is this implemented? Is it more efficient than just calling getObjectByIdentity N (=listOfKeys.size()) times? Thanks, Marton On Sep 8, 9:14 pm, Max Ross

[appengine-java] HttpSession handling question

2009-09-03 Thread Marton Papp
Hi! I am using HttpSession to store some information as session attributes. When I am testing the application locally, it works fine. But when I upload it to production, it seems that any session attributes that I retrieve from the session and modify it are not persisted back to the session