Problem with session - Google App Engine for Java | Google Groups
-
I store my object in memcache using the session.getId() identifier
of my JVM :
import javax.cache.Cache;
import javax.cache.CacheException;
import javax.cache.CacheFactory;
import javax.cache.CacheManager;
…
class MyController {
def find = {
def session = request.getSession(true)
def cache = CacheManager.getInstance().getCacheFactory().createCache
(Collections.emptyMap())
def map = new HashMap()
for (Place place : places.getPlacesList()) {
for (int i = 0; i < place.mapUrls.length; i++ ) {
map.put('cachedMapUrl'+i, place.mapUrls[i]) ;
}
}ByteArrayOutputStream baos = new ByteArrayOutputStream()
ObjectOutputStream oos = new ObjectOutputStream(baos)
oos.writeObject(map)
cache.put("mapUrls", baos.toByteArray())
CacheManager.getInstance().registerCache("_ahs" + session.getId(),
cache)
[places : places, jsessionId : session.getId()]
}2) I retrieve my object from the cache : jessionId being retrieved
…
}
from http request params
def changeZoom = {
def cache = CacheManager.getInstance().getCache("_ahs" + params
['jsessionId'])
def buf = (byte[]) cache.get("mapUrls")
ByteArrayInputStream bais = new ByteArrayInputStream(buf);
ObjectInputStream ois = new ObjectInputStream(bais);
def map = (HashMap) ois.readObject()
def mapUrl = map.get('cachedMapUrl'+zoomIndex)
}
intient (intient) on Twitter
-
Nimble 0.3-SNAPSHOT pushed to #grails plugin repo.
"grails install-plugin nimble 0.3-SNAPSHOT" to get you started.
Creating, Getting and Deleting Data - Google App Engine - Google Code
-
For a key for an entity with an entity group parent, you can use the KeyFactory.Builder class:
import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.datastore.KeyFactory;
// ...
Key k = new KeyFactory.Builder(Employee.class.getSimpleName(), 52234).addChild(ExpenseReport.class.getSimpleName(), "A23Z79").getKey();The Builder instance's
addChild()method returns the Builder, so you can chain calls to add each element of the key path. To get the complete Key value for a given builder, you call the Builder'sgetKey()method.
getting multiple objects fails - Google App Engine for Java | Google Groups
-
The getObjectsById function hasn't been optimized to perform a batch get, so
you're just as well-off issuing multiple calls to getObjectById. If you need
to issue a batch get, you'll need to use the low-level API. -
The getObjectsById function hasn't been optimized to perform a batch get, so
you're just as well-off issuing multiple calls to getObjectById. If you need
to issue a batch get, you'll need to use the low-level API. - 2 more annotations...
Using more Google App Engine SDK services with a Groovlet and Gaelyk - Messages from mrhaki
Top Tags
Public Tags (8)
Samir Caus's Public Lists (0)
No lists have been created yet.
"List" is a great way to organize, share and display your specific collection of bookmarks.
Highlighter, Sticky notes, Tagging, Groups and Network: integrated suite dramatically boosting research productivity. Learn more »
Join Diigo