Hi ! I have a problem with persist a class. 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. 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);
//pm.makePersistent(unEquipo);
pm.makePersistentAll(unTorneo);
tx.commit();
System.out.println("persistioTorneoConEquipo");
} finally {
pm.close();
if (tx.isActive()) {
tx.rollback();
}
}
}
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.