In the GAE/J documentation under "How-To | Handling Scheduled
Maintenance Periods", it states:

"During this period, all datastore writes and transactions will throw
an exception. Your application can detect these errors and indicate to
the user that the application is in read-only, recommending that they
try again later."

An example is then given to catch the relevant exception during
PersistenceManager#makePersistent(...), but I cannot find an example
for datastore updates of already-existing entities.

Does anyone know at what point an update to a persistent entity (not
using PersistenceManager#makePersistent(...)) will result in the
CapabilityDisabledException exception being thrown? For example, where
in the following code extract could I expect this exception?

    // Non-GAE method to return the singleton instance
    PersistenceManagerFactory pmf =
DataExchange.getPersistenceManagerFactory();

    PersistenceManager pm = pmf.getPersistenceManager();
    Transaction tx = pm.currentTransaction();

    try
    {
      tx.begin();

        // Non GAE method to get a detatched instance by its ID
(within the current tx)
        Item itemEdit = findItemByID(tx, pidData.loID,
loLoggedOnUserID);

        // Non GAE method to amend the itemEdit instance
        itemEdit = updateItemWithPageItemData(tx, itemEdit, pidData,
ipmMode);

        tx.commit();
    }
    finally
    {
      try
      {
        if (tx.isActive())    // Because of an exception, say
        {
          tx.rollback();
        }
      }
      finally
      {
        pm.close();
      }
    }

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