Google App Engine - How does datastore initialization work across sessions? <p>I'm developing my first project for GAE, and I'm wondering about how to go about setting up my connection to the datastore.</p> <p>Currently, I have the following in the header.jsp, which is included in all pages and includes a reference to a Datastore class that I created. </p> <p>header.jsp:</p> <pre><code>&lt;%@ page import="foo.Datastore"%&gt; &lt;% if (Datastore.getDatastore() == null) { DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Datastore.setDatastore(datastore); } %&gt; </code></pre> <p>Datastore.java:</p> <pre><code>public class Datastore { private static DatastoreService ds; public static DatastoreService getDatastore() { return ds; } public static void setDatastore(DatastoreService d) { ds = d; } } </code></pre> <p>Will this connect me to the SAME datastore every time I use the application? If so, can you explain how this works? How does <code>DatastoreServiceFactory.getDatastoreService()</code> know which datastore to connect to? Thanks!</p>