I'm using the Google AppEngine, with Java. When I use some datastore
features, I'm getting an error message:
 "Objeto con id "model.fe...@cf17c3" es manejado por otro
ObjectManager".

The code:
public void crearPartido(String nombre1, String nombre2,Date
fecha,Fecha fechaAgreg) {
                //JDOHelper.getPersistenceManager(obj);
                PersistenceManager pm2 = PMF.get().getPersistenceManager();
                Transaction tx = pm2.currentTransaction();
                try {
                        tx.begin();
                        Equipo eq1= new Equipo(nombre1, "", "");
                        Equipo eq2=new Equipo(nombre2,"","");
                        Partido par1=new Partido("", "", eq1,eq2, fecha);
                        fechaAgreg.agregarPartido(par1);
                        pm2.makePersistent(fechaAgreg);


                } finally {
                        tx.commit();
                        pm2.close();
                        if (tx.isActive()) {
                                tx.rollback();
                        }
                }

        }

And the persistent manager class:

public final class PMF {
        private static PersistenceManagerFactory pmfInstance = null;

        public static PersistenceManagerFactory get() {
                if ((pmfInstance == null )||(pmfInstance.isClosed())){
                        pmfInstance = JDOHelper.
                                
getPersistenceManagerFactory("transactions-optional");
                }

                return pmfInstance;
        }
}
Regards!
Lisandro

-- 
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 [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