Hi, I have a functioning app and recently have had intermittent
problems writing to the datastore. I did not make any relevant code
changes, however in the last few days my attempts to write to the
datastore sometimes work and sometimes don't.
I am trying to save an object that is in a many to one relationship
with an existing persisted parent. So, the logic works like this:
- Parent pulled from the
datastore
- Child created / instantiated
using constructor
- Parent.addSingleChild(child); //
the "addSingleChild" method
just adds the object argument to the collection of children
- child.setParent(Parent); // sets the
Parent object to the
parent field
I am using transactions as explained in the documentation ending with
"finally {if (tx.isActive()) {tx.rollback(); } }"
When the servlet is called, the parent is called from the datastore
and the child object is created and added to the many to one mapping
to the pre-existing parent.
The child should automatically be persisted, since the parent is
already persistent, and the child is added to the collection of
children that map to the parent. And it worked this way in the
past. However, to be sure, i did add a pm.makePersistent(child).
Doesn't seem to help, still have the intermittent problem.
Any suggestions would be appreciated, and if you need to see the
actual code I can post. Thanks
appid is omrtest
--
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.