Google App Engine - org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed

后端 未结 3 1016
故里飘歌
故里飘歌 2021-01-18 09:58

Why does the code below result in org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed? The exception appears to be thrown at query.getResultList(

3条回答
  •  感动是毒
    2021-01-18 10:24

    I don't know why exactly, but it seems to have to do with query.getResultList() being lazy-loaded. Apparently the lazy-loading breaks down when you call remove(token).

    As a work-around can you collect the ids/keys for the elements in an ArrayList first, and in a separate loop remove them from the datastore?

提交回复
热议问题