Results 1 to 2 of 2

Thread: EntityManager was not closed after non-transactional query

  1. #1
    Join Date
    Oct 2005
    Posts
    14

    Unhappy EntityManager was not closed after non-transactional query

    I used spring Roo m2 to generate some code and run it on GAE.

    I have some issues. Here is what I want to do
    -- run a query to get a couple of entities (e.g. price promotions)
    -- update each entity (expire promotion)
    -- add one new eneity (create new promotion)

    The first step "query" does not have to be in one tx. The problem is that the entityManager is not closed after the query is executed, which causes the next step fail on GAE. The error message is
    xxxObject is managed by a different Object Manager;

    My question is how can I explicitly close the entityManager after the query without declaring it is "transactional". em.close() does not work as Spring inject SharedEntityManagerInvocationHandler which does nothing when close() method is called.

    BTW, I cannot make the query "transactional" because GAE does not allow one transaction deal with entities in different entity group, even it is just a query. In my case, the price promotions belong to different products which are top level entities and are in different entity groups...

  2. #2
    Join Date
    Oct 2005
    Posts
    14

    Default

    anybody can help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •