Hi ! I have a problem with persist a class. It is strange...
The problem is that sometimes, persist and sometimes not persist the
class "Equipo" .
I have a persist class "Torneo" that has to many class "Equipo", and
when persist "Equipo" sometimes persist in the datastore and sometimes
not persist.
I have to try restarting the application in order that sometimes it
work.... Bug of datanucleus of AppEngine???...
Someone will be able to help me?
The code to persist:
public void agregarEquipoConTorneo(Torneo unTorneo, Equipo
unEquipo)
{
/*add Equipo with a existing "Torneo" in the
datastore, the
"unTorneo"(param) class obtain with: Torneo b =
pm.getObjectById(model.Torneo.class, idTorneo);*/
Transaction tx = pm.currentTransaction();
try {
tx.begin();
unTorneo.agregarEquipo(unEquipo);
//add unEquipo to collection "equipos"
pm.makePersistentAll(unTorneo);
tx.commit();
System.out.println("persistioTorneoConEquipo");
} finally {
pm.close();
if (tx.isActive()) {
tx.rollback();
}
}
}
I have tried with:
tx.begin();
pm.makePersistent(unEquipo);
unTorneo.agregarEquipo(unEquipo);
tx.commit();
But Neither it works....They suggested me to use "Attach/Detach", but
it did not work either...
Thanks!
Regards
--
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.