hello,

I'm facing a problem about the persistence of some of my objects.
i have a class which is persistent capable and i don't think there is any 
error in it

*CODE*

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable
public class GiniChat {

@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
@Persistent
private String ChatName;
@Persistent
private List<String> users;
 public GiniChat (String CN) {
ChatName = CN;
users = new ArrayList<String>();
}
....
*/CODE*
*
*
I am creating new persistent objects using this code:

*CODE*
*
*
c_chatName = req.getParameter("chatname");
    GiniChat GC = new GiniChat(c_chatName);
    PersistenceManager pm = PMF.get().getPersistenceManager();
    try {
    pm.makePersistent(GC);
    System.out.println("Success");
    } finally {
     pm.close();
     }
    
    chats.put(c_chatName, GC);
*/CODE*

And I get these objects back in the client side using this code:

*CODE*

PersistenceManager pm = PMF.get().getPersistenceManager();
String query = "select from " + GiniChat.class.getName();
List<GiniChat> tmpchats = (List<GiniChat>) pm.newQuery(query).execute();

*/CODE*

When i try to add a GiniChat object, it looks like it works but when i 
reload the client (which is supposed to get these objects back), i don't get 
anything back from the datastore, except objects that i previously created, 
using the same class but with different attributes (actually i just added 
the users' list). All newly created objects seem not to be persistent, or a 
least not in this class. Is it possible that because i changed the structure 
of my class, it is now stored somewhere else ?

summary:
-when i try to add an object, it seems to work
-but when i try to get it back from the datastore, it fails
-it was ok before
-not anymore since i changed the structure of my class

Thank you for your help

Max

PS: sorry for my english

-- 
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/-/Tl0P5tYxk8wJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to