EntityQuery Performance, just don't get it
hardaur Aug 20, 2009 4:16 PMI'm working on doing some light performance tuning of a Seam 2.1.1 app that makes heavy use of EntityQuery objects. The primary problem I have is the extremely repetitive queries being run when a page is loaded do to JSF and getters. So I'm trying to find ways of getting around that and have been googling for a couple days. It seems as though there are two ways around it based on what I've found: bypassing interceptors or using a factory method. I've chosen the later and it does avoid the queries, however. . there is one MAJOR problem. There are a few ways to explain it (it's the same with all filtering), but let's use paging.
1. I load the page (page 1) everything's groovy.
2. I use EntityQuery.next() to go to page 2 - It still shows page 1
3. I use EntityQuery.next() to go to page 3 - It now shows page 2
4. I use EntityQuery.next() to go to page 4 It now shows page 3
Same for filtering: If I load page all are shown, if I filter for x (via restrictions) it still shows all, if I filter for y, it'll show the x filters applied.
Here's the relevant code (I think):
From the xhtml:
<ice:dataTable id="entityListDataTableId" var="myEntity" value="#{customResultList}" rendered="#{not empty customResultList}" width="100%">
From the EntityQuery object:
@Factory(value = "customResultList", scope = ScopeType.EVENT) public List customResultListInitializer() { return getResultList(); }
I'm using icefaces, so using ScopeType.EVENT as a PAGE is very rare. Like I said, in general everything is working fine, just have a sync issue.
So, I'm feeling pretty stupid, after tons and TONS of googling I've found very little. Am I the only one out there that's missing out on some big secret on how to do this? : b Am I doing something slightly wrong? Is there another way entirely that I'm missing out on?
Thanks for any and all assistance!
Gerald