0

I'm using primefaces. I have data in p:datatable. I'm editing a row in a dialog. When I do it fast (in less than 40 seconds) everything is OK (i can save the data) but if I edit the data for some time all the data in the bean (manegedBean, vievscope) becomes null and the PostConstruct method is called - I lose the edited selectedRow data.

Wesley Bland
  • 8,816
  • 3
  • 44
  • 59
TajnosAgentos
  • 167
  • 1
  • 1
  • 10
  • In other words, the view/session has just expired? And you have "enable restore view JSF 1.1 compatibility" enabled in `web.xml`? – BalusC Aug 13 '14 at 17:47
  • Did it and it didnt help. The second load (after over 40 seconds) is a PostBack (FacesContext.getCurrentInstance().isPostBack()). Any ideas? – TajnosAgentos Aug 14 '14 at 07:00
  • You should **not** have it. You should normally get a `ViewExpiredException` if the view/session has expired. – BalusC Aug 14 '14 at 07:18
  • I dont get this error. I get a UpdateModelException and PropertyNotFoundException. The selectedRowData becomes null after some time... – TajnosAgentos Aug 14 '14 at 07:40
  • I know. As you didn't seem to attempt to investigate/debug why exactly it becomes null, I'm just trying to investigate it for you so that you can ultimately get your answer. An expired session is one of probable causes. That's why I asked about that. So, once again the question: has the view/session just expired? Just answer with "Yes" or "No" or "I have no utter idea how to check that". – BalusC Aug 14 '14 at 07:41
  • The menagedBean is recreated alter time and i loss the data. What can I do to fix it? – TajnosAgentos Aug 14 '14 at 07:46
  • I know. I'm all the time trying to determine the cause by asking questions which you structurally ignored. For the last time the question: has the view/session expired? – BalusC Aug 14 '14 at 07:46
  • "I have no utter idea how to check that" – TajnosAgentos Aug 14 '14 at 07:50
  • One way is to check the value of the `JSESSIONID` cookie in your browser's HTTP traffic monitor (press F12 and open "Network" tab). Another way is to implement a `@WebListener HttpSessionListener` and put some sysout or logger lines in `sessionCreated` and `sessionDestroyed` methods. Another way is to print `HttpSession#getId()` in `@PostConstruct` of your bean. – BalusC Aug 14 '14 at 07:53
  • sesson didnt expired (its set on 60 minutes) the rest of the application works fine. Un a different bean the postConstructor method is called every (more or less)t 40 seconds (postBack) – TajnosAgentos Aug 14 '14 at 08:04
  • Ok, session has not expired, but the view has likely expired. Are you using Mojarra or MyFaces? Are you using `` anywhere in the view? Check browser's HTTP traffic monitor. Do you see repeated ajax postbacks on the same view (i.e. with same or changed `javax.faces.ViewState` parameter value). – BalusC Aug 14 '14 at 08:22
  • Thank You Very Much. I have an item that is refreshing every 60 seconds and the error is because that. Found it thanks to the Traffic Monitor. Thank You again for Your time. – TajnosAgentos Aug 14 '14 at 08:32
  • Glad. But actually the `` should **not** have destoyed the view. There's more at matter. A [MCVE](http://stackoverflow.com/help/mcve) along with exact specification of libraries/impls/versions used should help in nailing down the bug. – BalusC Aug 14 '14 at 09:14

0 Answers0