You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yee CN <ye...@streamyx.com> on 2005/11/22 03:36:31 UTC

dataTable inefficiencies - hit db twice on each request

Hi,

 

I noticed that if preserveDataModel=false, then JSF will attempt to fetch
the table data twice - once during the apply request values phase, and once
during the render response phase. It doesn't do that if
preserveDataModel=true, but then I don't get proper sorting in the table.

 

Hitting the database twice on every request is not acceptable - so is there
a way around this?

 

Thanks

Yee

 


Re: dataTable inefficiencies - hit db twice on each request

Posted by Enrique Medina <e....@gmail.com>.
You can simply set your backing bean as session-scoped.

Also take a look at:
http://wiki.apache.org/myfaces/Working_With_DataTable_And_PreserveDataModel

2005/11/22, Yee CN <ye...@streamyx.com>:
>
>  Hi,
>
>  I noticed that if preserveDataModel=false, then JSF will attempt to fetch
> the table data twice – once during the apply request values phase, and once
> during the render response phase. It doesn't do that if
> preserveDataModel=true, but then I don't get proper sorting in the table.
>
>  Hitting the database twice on every request is not acceptable – so is
> there a way around this?
>
>  Thanks
>
> Yee
>
>