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

后端 未结 3 857
故里飘歌
故里飘歌 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?

    0 讨论(0)
  • 2021-01-18 10:35

    Adding @Transactional to the method prevents the object manager from closing. However, I'm not sure why it closes without this.

    0 讨论(0)
  • 2021-01-18 10:51

    the solution that worked for me and a description of the bug i found here:

    http://groups.google.com/group/google-appengine-java/browse_thread/thread/945f6ca66c1c587e

    0 讨论(0)
提交回复
热议问题