Hi all,

looks like the local datastore needs a call to the makePersistent() method every time an object is modified for make the changes persistent.
For example the following method works only with the second makePersistent() method call;
--------------------------------
        PersistenceManager pm = PMF.get().getPersistenceManager();
        User user = new User();      
        pm.makePersistent(user);                                       <--- first makePersistent() call
        pm.close();

        pm = PMF.get().getPersistenceManager();
        Transaction tx = pm.currentTransaction();
        for (int i = 0; i < txDatastoreNumRetries; i++) {
            tx.begin();

            user.update(timestamp);
            pm.makePersistent(user);                                    <--- second makePersistent() call
            try {
                pm.currentTransaction().commit();
                break;

            } catch (JDOCanRetryException ex) {
                if (i == (txDatastoreNumRetries - 1)) {
                    logger.severe("DatastoreTransactionException: Trying to update the same user calls stats concurrently. " +
                            "No more retries left. Update aborted. User: " + user.getUserId());
                    break;
                }
            }
        }
        if(tx.isActive()) {
            tx.rollback();
        }
        pm.close();       

-----------------------------

Wasn't the makePersistent method call needed just at object creation...??
Is this a GAE SDK problem ???

Thanks



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