I have a question about JDO Lifecycle Listeners and transactions.

Suppose that I have set a StoreLifecycleListener for a
PersistenceManager, then initiated a transaction.  When I call
commit(), this triggers some saves to the Datastore, and the
preStore() and postStore() methods get called.

My question: if a Datastore save is triggered by a transaction commit,
will postStore() be called ONLY if the transaction commits
successfully?

My guess is that no, it will be called regardless, before the commit
does/does not go through.  The reason I think this, is that if I call
makePersistent() mid-transaction, I see that postStore() is called
then as well.
Does anyone know the definitive answer to this? (apologies if I missed
it in the docs somewhere).

On a related note :), is there a good way to simulate a transaction
commit failure due to contention? I often want to test things like the
above and do not know a good way to force a commit failure in order to
find out.

-- 
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.

Reply via email to