Hi Ikai, It says in that forum that it's 'probably' not thread safe, so is it thread safe or not? If its not threadsafe then we should never use a singleton instance.
Can you give us a more definitive answer such as it's not threadsafe so never cache the instance, or it is threadsafe so therefore it is up to us. It would be very helpful. thanks, Matt On Fri, Apr 2, 2010 at 9:54 AM, Ikai L (Google) <[email protected]> wrote: > You're probably best off creating new instances of DatastoreService. There > are some good points raised here: > > > https://groups.google.com/group/google-appengine-java/browse_thread/thread/e19b792042b2ff9b# > > On Fri, Apr 2, 2010 at 1:26 AM, Matt Farnell <[email protected]> wrote: > >> I finally figured it out, its on the Datastore config level. >> >> DatastoreServiceConfig config = >> DatastoreServiceConfig.Builder.withReadPolicy(new ReadPolicy(Consistency. >> EVENTUAL)); >> >> DatastoreService dss >> = DatastoreServiceFactory.getDatastoreService(config); >> >> I thought it would have been on the Query object as it is in the JDO >> example posted in the blog. I was using a singleton as I thought we were >> only meant to instantiate one DatastoreService instance and reuse it?? >> >> >> On Fri, Apr 2, 2010 at 1:04 AM, lepah <[email protected]> wrote: >> >>> Hi there, >>> >>> How can I use this with the low level datastore, I've looked around in >>> the JavaDocs and found ReadPolicy.Consistency but couldn't find >>> anywhere to set it. It could be just me as it's 1AM. Would love to try >>> it out. >>> >>> On Apr 1, 11:39 am, Isdal <[email protected]> wrote: >>> > Thanks Ikai! >>> > >>> > I noticed that the docs are updated now too. This page has a couple >>> > examples on it as well: >>> http://code.google.com/appengine/docs/java/datastore/usingjdo.html >>> > >>> > // Tomas >>> > >>> > On Mar 30, 3:57 pm, "Ikai L (Google)" <[email protected]> wrote: >>> > >>> > >>> > >>> > > Yep. The example is documented here: >>> > >>> > > >>> http://googleappengine.blogspot.com/2010/03/read-consistency-deadline... >>> > >>> > > < >>> http://googleappengine.blogspot.com/2010/03/read-consistency-deadline.. >>> .>Query >>> > > q = pm.newQuery(Employee.class); >>> > > q.addExtension("datanucleus.appengine.datastoreReadConsistency", >>> > > "EVENTUAL"); >>> > >>> > > On Fri, Mar 26, 2010 at 5:12 PM, Isdal <[email protected]> >>> wrote: >>> > > > Hi all, >>> > >>> > > > Thanks for all new new features in 1.3.2! >>> > >>> > > > I was just wondering if it is possible to use the >>> > > > "ReadPolicy.Consistency.EVENTUAL" feature and still use the JDO >>> > > > interface. >>> > >>> > > > I am currently getting a PersistenceManager with: >>> > > > JDOHelper.getPersistenceManagerFactory("transactions- >>> > > > optional"); >>> > >>> > > > Is there a way to tell the PersistenceManager to tell the datastore >>> to >>> > > > accept eventually consistent reads? Most of my app can handle stale >>> > > > data, and any performance improvement would be great! >>> > >>> > > > Thanks! >>> > >>> > > > // Tomas >>> > >>> > > > -- >>> > > > 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]<google-appengine-java%[email protected]><google-appengine-java%2B >>> [email protected]> >>> > > > . >>> > > > For more options, visit this group at >>> > > >http://groups.google.com/group/google-appengine-java?hl=en. >>> > >>> > > -- >>> > > Ikai Lan >>> > > Developer Programs Engineer, Google App Enginehttp:// >>> googleappengine.blogspot.com|http://twitter.com/app_engine >>> >>> -- >>> 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]<google-appengine-java%[email protected]> >>> . >>> For more options, visit this group at >>> http://groups.google.com/group/google-appengine-java?hl=en. >>> >>> >> -- >> 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]<google-appengine-java%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/google-appengine-java?hl=en. >> > > > > -- > Ikai Lan > Developer Programs Engineer, Google App Engine > http://googleappengine.blogspot.com | http://twitter.com/app_engine > > -- > 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]<google-appengine-java%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/google-appengine-java?hl=en. > -- 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.
