2 Replies Latest reply on Feb 19, 2010 11:01 AM by null null

    ExtendedDataModel's examples all have same bug?

    null null Novice

      Every extendedDataModel caches the count, but they don't cache the sql query that goes after.  Isn't this a bug in that if you keep paging, and the data count in teh database has changed, you are going to be missing data(especially if some data is deleted!!!)...you could have a count of 50 and go to the last page(pages of 10) and the count is then 39 so the last page would load what data with scrollableDataTable.

       

      I am wondering how I can cache the count but reset it when

      1. user pages

      2. user hits the refresh button in the browser

       

      I was hoping only to keep my bean in the request scope maybe so that would fix this problem maybe?

       

      any ideas on how to keep the example in request scope in seam so the cache clears?

       

      thanks,

      Dean

        • 1. Re: ExtendedDataModel's examples all have same bug?
          Ilya Shaikovsky Master
          I think you need to explore our demos at richfaces-demo dataTable page to check our ExtendedDataModel and Modifiable implementations. Only in this way you could get the control you need. Default JSF model implementation didn't care about how the data fetched really in your app and just calls the list you pointed in value every time.
          • 2. Re: ExtendedDataModel's examples all have same bug?
            null null Novice

            I assume you are talking about

            http://livedemo.exadel.com/richfaces-demo/richfaces/extendedDataTable.jsf?tab=usage&cid=1550555 ???

             

            but I don't see any java source code.  I did manage to get the model into the event scope but then every time I selected a row, it reran all the queries so I put the model int he conversation scope and then put rowCount in the event scope but in this case, I also ended up with a single select count(*) query every time the user selected a row.  Is there any way to prevent getRowCount from being called when a row is selected?  I mean, the user is selecting a row from the first page(50 results) of a 120 count result set so why does it need to know there is 120 results when there is only 50 on the page the user can select from.  If I could solve this last problem, the bug would be fixed, and rowCount would only be used per http request for the page itself such that if results are deleted added, things still work smoothly.  It appears everyone else is caching rowCount in the examples on the web which breaks stuff when deleting adding records since you don't have the true count over time.

             

            thanks for any links where I can go look at more code and try to figure this out.