We have created a page which allows a user to page through a bunch of entities displayed in a DataTable ( 30 per page ). The page is one part of a few pages in a conversation. From an action/conversation perspective, we only ever have one page worth of data in memory at one time.
However, since we are retrieving our entities from the entityManager, all the entities reside in the entityManager. Our problem is, if you page through a large result set of data, the entities continue to grow in the entityManager until the conversation is done ( or you run out of memory ).
Also, we can't do a clear() on the entityManager because other pages in the conversation contain entities that need to be managed.
A nested conversation doesn't work either because the entity manager seems to span both the parent and the nested conversation.
Has anyone seen this or have a solution to this issue?
Have one conversation scope entityManager and one event scope entityManager.