Hi

I had a similiar problem where I was looping over a set of entities,
within a transaction
fetching a referenceproperty, updating the total in the referenced
entity, then doing a
put on the referenced entity.

I found when using the sqlite backend on the dev SDK the puts worked
(i sqlite doesn't
have transactions) but in production it didn't.

So what I did was used nick johnsons prefetch property recipe
http://blog.notdot.net/2010/01/ReferenceProperty-prefetching-in-App-Engine
But then modified it to use a cache that can be supplied to the
function.

So that when we fetched the entity the first time, it would be
cached,
updating and putting would still update the cached version
but subsequent fetches of the reference property would always
give me the exact same instance, so the incremented totals where
correct.

I am not saying this will solve your problem (Especially if your using
Java ;-) but it may be a
strategy worth looking at.


Regards

Tim

On Sep 8, 2:11 pm, Richard Thomas <[email protected]> wrote:
> Hello, everyone. I've been stuck on an issue with app engine for quite
> a while now. I've got a rather complex set of changes that I want to
> bundle in a transaction but the logic of the changes is in many places
> dependent on what changes were made earlier. It seems that changes
> made earlier in a transaction are not visible even to the transaction
> code itself until its committed. Is there a way to circumvent that?
> I've tried breaking things down into smaller less logically confusing
> transactions but such efforts inevitably end up being impossible to
> rollback if an error occurs later.
>
> I don't know what to try short of copying the entire entity group to
> some dummy objects and writing it back when I'm done. What's the
> reasoning behind this behaviour anyway? Its certainly not how other
> transaction systems work...
>
> Thanks in advance,
> Richard.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" 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?hl=en.

Reply via email to