That seems to have fixed it, thanks.

For the AppEngine developers - surely this is a bug. We shouldn't have
to define an index on the primary key, should we?

On Mar 15, 4:21 am, thierry LE CONNIAT <thlec...@free.fr> wrote:
> HI,
>
> I think it's just a problem of index missing on object Presence.
> TRy to add a index's description.
>
> bye
>
> On 15 mar, 07:59, Philip Tucker <ptuc...@gmail.com> wrote:
>
>
>
> > I have a Room class containing a list of Presence classes. Here are
> > the annotations.
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Room {
> >   private final static Logger LOG =
> > Logger.getLogger(Room.class.getName());
>
> >   @PrimaryKey
> >   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   private Key key;
>
> >   @Persistent
> >   private Key creatorKey;
>
> >   @Persistent
> >   private String name;
>
> >   @Persistent(mappedBy = "room")
> >   @Element(dependent = "true")
> >   private List<Presence> presences;
>
> > ...
>
> > }
>
> > @PersistenceCapable(identityType = IdentityType.APPLICATION)
> > public class Presence {
> >   @SuppressWarnings("unused")
> >   @PrimaryKey
> >   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   private Key key;
>
> >   @Persistent
> >   private Key userKey;
>
> >   @SuppressWarnings("unused")
> >   @Persistent
> >   private Room room;
>
> >   @Persistent
> >   private long lastAccessMs = 0;
>
> > ...
>
> > }
>
> > I'm getting an error when I remove multiple entries from presences via
> > removeAll. Here's the stack trace. I see this error only on the live
> > site, not on a local build.
>
> > com.google.appengine.api.datastore.DatastoreNeedIndexException: no
> > matching index found..      <datastore-index kind="Presence"
> > ancestor="true" source="manual">
> >         <property name="__key__" direction="desc"/>
> >     </datastore-index>
>
> >         at
> > com.google.appengine.api.datastore.DatastoreApiHelper.translateError(Datast 
> > oreApiHelper.java:
> > 39)
> >         at
> > com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall(Datastor 
> > eApiHelper.java:
> > 60)
> >         at
> > com.google.appengine.api.datastore.PreparedQueryImpl.runQuery(PreparedQuery 
> > Impl.java:
> > 115)
> >         at
> > com.google.appengine.api.datastore.PreparedQueryImpl.asIterator(PreparedQue 
> > ryImpl.java:
> > 81)
> >         at com.google.appengine.api.datastore.BasePreparedQuery
> > $1.iterator(BasePreparedQuery.java:25)
> >         at
> > org.datanucleus.store.appengine.DatastoreAbstractListStoreSpecialization.ge 
> > tIndicesOf(DatastoreAbstractListStoreSpecialization.java:
> > 124)
> >         at
> > org.datanucleus.store.mapped.scostore.AbstractListStore.getIndicesOf(Abstra 
> > ctListStore.java:
> > 393)
> >         at
> > org.datanucleus.store.mapped.scostore.AbstractListStore.removeAll(AbstractL 
> > istStore.java:
> > 232)
> >         at org.datanucleus.sco.backed.List.removeAll(List.java:957)
> >         at com.honkentuber.chat.Room.updatePresence(Room.java:97)
> >         at
> > com.honkentuber.chat.ChatDatabase.storeAndFetchMessages(ChatDatabase.java:
> > 212)
> >         at com.honkentuber.chat.ChatServlet.newJspResponse(ChatServlet.java:
> > 36)

-- 
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 google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to