Hi Cosmin,

I do not see any calls to

  pm.makePersistent(...);

I use this to persist newly-created persistent instances.

I know that you do not use transactions, but I do. Within an active
transaction, one can update persistent instances and even persist or
delete entity group child instances without calling

  pm.makePersistent(...);

Have you looked at the GAE persistence blog of Max Ross or Google?
There are some excellent working examples there...

Ian


On Feb 28, 6:55 pm, Cosmin Stefan <cosmin.stefandob...@gmail.com>
wrote:
> So no ideea anyone?
>
> On Feb 25, 11:42 pm, Cosmin Stefan <cosmin.stefandob...@gmail.com>
> wrote:
>
> > Hey,
>
> > I have an issue while trying to update one object in a collection,
> > using JDO.
>
> > Here are the facts:
> >    o i have a class (let's call it BigClass), that has an embedded
> > class(SmallClass) containing an ArrayList.
> >    o I DONT use/need a transaction
> >    o I query the database to get a List of BigClass items that should
> > be modified. I iterate through each of them and I...
> >    o I remove an element from the list in the SmallClass embedded in
> > the current BigClass, the changes are not ALWAYS persisted
> >    o if I print (log) the object after the change, it looks modified,
> > but if i check the DataViewer, the object was not updated
> >    o i even tried using JDOHelper.makeDirty on the BigClass, with the
> > fieldName SmallClass, and it still doesn't work.
>
> > Some relevant code:
>
> >                                 Query q = 
> > pm.newQuery(BigClass.class,"id==:ids");
> >                                 List<BigClass> 
> > participatingUsers=(List<BigClass>)
> > q.execute(participantIDs);
>
> >                                 //Update the participants
> >                                 ListIterator<BigClass> 
> > it=participatingUsers.listIterator();
> >                                 BigClass participant;
> >                                 boolean modified;
> >                                 while(it.hasNext())
> >                                 {
> >                                         participant=it.next();
> >                                         participant.list.remove(smth);
>
> > JDOHelper.makeDirty(participant,"collection");
> >                                }
> >                                ....
> >                                modify other objects
> >                                ....
> >                                pm.close()
>
> > Another thing is that some of the changes I make after this part are
> > persisted...
>
> > So, if you have any suggestions, shoot pls!
>
> > Cosmin
>
>

-- 
You received this message 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