Hi Patrizio,

It is hard to say anything without seeing your code. For me even this
runs without a problem in JUnit test:

                PersistenceManager pm = pmf.getPersistenceManager();
                pm.currentTransaction().begin();

                ParentOfList p = new ParentOfList();
                pm.makePersistent(p);
                pm.flush();

                Child c = new Child();
                p.getChildren().add(c);
                pm.makePersistent(p);
                pm.makePersistent(c);

                pm.currentTransaction().commit();
                pm.close();

I am calling makePersistent() multiple times, in theory it should be
failing, still it does not.


Marton


On Sep 25, 9:23 am, Patrizio Munzi <patrizio.mu...@eris4.com> wrote:
> Any opinion...??
> Google?
> Patrizio Munzi wrote:Hi Marton,
> I think I've worked out what was the problem with my JUnit tests.
> I was persisting a parent entity before its children.
> The strange thing however is that I didn't have any problem running the same 
> code in GAE local server.
> Now the question is what's the correct behavior??
> I thing this could be an issue.
> Patrizio Munzi wrote:Hi,
> yep the same code runs 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 to update 
> the same entity more than once in a single transaction. However I was not 
> able to reproduce the problem. Could you send me some code example that 
> fails? Thx. The 
> docs:http://code.google.com/appengine/docs/java/datastore/transactions.html----
>  An attempt to update the same entity multiple times in a single transaction 
> (such as with repeated makePersistent() calls) will throw a 
> JDOFatalUserException. Instead, just modify the persistent objects within the 
> transaction, and allow the call to commit() to apply the changes. ---- Marton 
> On Sep 24, 1:53 pm, Patrizio Munzi<patrizio.mu...@eris4.com>wrote:Hi all, I'm 
> having this exception/error only in JUnit tests. Where's the problem? In the 
> SDK or UNIT tests?? Thanks--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi--
>
> Patrizio Munzi
> Product Specialist
> Viale Bruno Buozzi, 19 - 00197 Roma (Italy)
> tel: +39 06 4543 3540
> fax: +39 06 4543 3587
> mobile: +39 393 7195 164
> mail:patrizio.mu...@eris4.com
> web:http://www.eris4.com
> skype:eris4_munzi
>
>
>
>  image_gif_part
> 1KViewDownload
>
>  image_gif_part
> 1KViewDownload
>
>  logo.gif
> 1KViewDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to