/ Published in: Java
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
private void clearSessions() { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Query query = new Query("_ah_SESSION"); PreparedQuery results = datastore.prepare(query); log.info("Deleting " + results.countEntities() + " sessions from data store"); datastore.delete(session.getKey()); } } // clearing everything in the cache, because sessions are also kept in memcache private void clearCache() throws CacheException { CacheFactory cacheFactory = CacheManager.getInstance ().getCacheFactory(); CacheStatistics stats = cache.getCacheStatistics(); log.info("Clearing " + stats.getObjectCount() + " objects in cache"); cache.clear(); }
URL: http://groups.google.com/group/google-appengine-java/browse_thread/thread/280c3fb95dac2314