Hi GArchitect, The index you list isn't suitable for that query - the index includes the 'id' field at the start, but you don't appear to be filtering or sorting on it.
-Nick Johnson On Mon, Jul 6, 2009 at 4:28 AM, GArchitect<tommy...@gmail.com> wrote: > > Hi, I got the following exception in a method executing a query: > > C 07-05 07:23PM 42.069 > Uncaught exception from servlet > com.google.appengine.api.datastore.DatastoreNeedIndexException: no > matching index found. > at > com.google.appengine.api.datastore.DatastoreApiHelper.translateError > (DatastoreApiHelper.java:34) > at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall > (DatastoreApiHelper.java:55) > at com.google.appengine.api.datastore.DatastoreServiceImpl > $PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:310) > at com.google.appengine.api.datastore.DatastoreServiceImpl > $PreparedQueryImpl.access$100(DatastoreServiceImpl.java:240) > at com.google.appengine.api.datastore.DatastoreServiceImpl > $PreparedQueryImpl$1.iterator(DatastoreServiceImpl.java:269) > at > org.datanucleus.store.appengine.query.RuntimeExceptionWrappingIterable.iterator > (RuntimeExceptionWrappingIterable.java:42) > at org.datanucleus.store.appengine.query.StreamingQueryResult.<init> > (StreamingQueryResult.java:72) > at > org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery > (DatastoreQuery.java:253) > at org.datanucleus.store.appengine.query.DatastoreQuery.performExecute > (DatastoreQuery.java:220) > at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute > (JDOQLQuery.java:85) > at org.datanucleus.store.appengine.query.JDOQLQuery.performExecute > (JDOQLQuery.java:31) > at org.datanucleus.store.query.Query.executeQuery(Query.java:1466) > at org.datanucleus.store.query.Query.executeWithArray(Query.java: > 1340) > at org.datanucleus.jdo.JDOQuery.execute(JDOQuery.java:240) > at > com.solveware.gwt.sample.stockwatcher.server.HistoricalQuote.getAllQuotesOnSymbol > (HistoricalQuote.java:130) > ... > > However, according to the admin console, the required index is up and > running > > HistoricalQuote > id ▲ , symbol ▲ , date ▲ Serving > > And the code for executing the query: > > public static List<HistoricalQuote> getAllQuotesOnSymbol(String > symbol) { > PersistenceManager pm = PMF.get().getPersistenceManager(); > Query query = pm.newQuery(HistoricalQuote.class); > query.setFilter("symbol == userSubmittedSymbol"); > query.setOrdering("date ASC"); > query.declareParameters("String userSubmittedSymbol"); > List<HistoricalQuote> entries = (List<HistoricalQuote>) > query.execute(symbol); > return entries; > } > > So I wonder if anyone can shed some light on why this is happening? > Is it a problem on the GAE side that is waiting to be fixed? > > Any help is appreciated. Thanks. > > Best, > > Tommy > > > > -- Nick Johnson, App Engine Developer Programs Engineer Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to google-appengine@googlegroups.com To unsubscribe from this group, send email to google-appengine+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---