GAE transaction exceptions
Posted
by bach
on Stack Overflow
See other posts from Stack Overflow
or by bach
Published on 2010-04-01T13:55:07Z
Indexed on
2010/04/01
14:53 UTC
Read the original article
Hit count: 289
Hi,
- In this example IS the exception being thrown if ANY of the Table elements are being changed by another client OR only if the element that we changed has been changed by another client?
Just to verify - the exception is thrown from the commit() isn't it?
PersistenceManager pm = PMF.get().getPersistenceManager(); try { pm.currentTransaction().begin(); List<Row> Table = (List<Row>) pm.newQuery(query).execute(); Table.get(0).setReserved(true); // <----- we change only this element pm.currentTransaction().commit(); } catch (JDOCanRetryException ex) { pm.currentTransaction().rollback() // <----- if Table.get(1) was changed by another client do we get to this point??? }
© Stack Overflow or respective owner