Well, OK, server-side state is *one* way to do pagination.
But an extended persistence context caches data in the server. It is never aware of any
changes you make to data via some other persistence context. So you must either:
(1) do any updates in the scope of the same persistence context OR
(2) use em.refresh()
if you want to see changes made by other contexts.
But the reality is that a SESSION scoped persistence context is always a bad thing (it is
a memory leak, to begin with), and you should never do that.
There are other ways to solve your problem. A great start is to not try to pass an entity
instance directoly from the search screen to the detail screen. Instead, re-fetch it using
find(), or merge it using merge().
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3975938#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...