Hello,

I was experiencing problems very similar to the ones described in this
thread:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/13473fcae300d845
where updates I made on my JDO objects weren't actually reflected in
the datastore. Taking the advice of an answer from that thread, I
tried closing and reopening the PersistenceManager in the following
order:

Initialize pm
Retrieve the parent object from the datastore using pm
Retrieve the list of child objects from the parent object (with a
simple method call)
Close pm
Re-initialize pm
Add a new child object to the list
Make the parent object persistent using pm

This actually works perfectly, as opposed to when the close and re-
initialization of pm are omitted, in which case the parent object's
list will not include the newly added child. However, because of this
closing of pm, I cannot put this entire update into a single
transaction, or an JDOUserException is thrown that tells me
'transaction is still active. You should always close your
transactions correctly using commit() or rollback()'. Everything works
fine if I separate this code into two transactions, but then it is
possible that two users interleave transactions such that they each
retrieve identical child lists from the same parent object, each add a
new child to that list, and the last to write will wipe out the child
added by the first. Any ideas or workarounds would be greatly
appreciated!

Thanks,
Greg

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to