Skip to main content

Home/ Google AppEngine/ Group items tagged upload

Rss Feed Group items tagged

Esfand S

Example of using new GAE libs - gwtupload | Google Groups - 0 views

  • public class DatastoreUploadAction extends AppEngineUploadAction {         @Override         public String executeAction(HttpServletRequest request, List<FileItem> sessionFiles) throws UploadActionException {                 String out = super.executeAction(request, sessionFiles);                 for(FileItem imgItem : sessionFiles) {                         PersistenceManager pm = ContentServiceImpl.getPersistenceManager();                         Transaction tx = pm.currentTransaction();                         try {                             // Start the transaction                             tx.begin();                             InputStream imgStream = imgItem.getInputStream();                                 Blob blob = new Blob(IOUtils.toByteArray(imgStream));                                 ImageBlob imageBlob = new ImageBlob(imgItem.getName(), blob);                             pm.makePersistent(imageBlob);                             // Commit the transaction, flushing the object to the datastore                             tx.commit();                         }                         catch(Exception e) {                                 e.printStackTrace();                         }                         finally {                             if(tx.isActive()) {                                 tx.rollback();                             }                             pm.close();                         }                 }             return out;         } }
Esfand S

Any ETA for a backup/restore facility? - Google App Engine for Java | Google Groups - 0 views

  • That was referring to the bulkloader, which lets you do those things. App Engine's datastore isn't a relational database. We can't do a dump of all your data without iterating through all of your indexes, then retrieving your Entities.
Esfand S

Google App Engine Cold Start Guide for Java - 0 views

  • Originally my application started out using Spring MVC and JDO. The first use of JDO took my application about 5 seconds to get everything set up.  Similarily, Spring MVC added around 6 seconds to the cold start  time
  •  If you are not using either JDO or JPA, you can safely delete all related libraries (ones that have JDO, JPA, or Datanucleus in their name) and use the command line tool to upload your app. Deleting these libraries shaves about 400ms off of cold start time.
« First ‹ Previous 41 - 52 of 52
Showing 20 items per page