[TYPO3-mvc] Fetching large result from repository
Jochen Rau
jochen.rau at typoplanet.de
Mon Dec 14 14:58:43 CET 2009
Hi Alex.
schrieb Alex Bailey:
> I'm having a little question and I don't know if it really is extbase/
> fluid related or something which has to do with my server. I've wrote a
> repository function which returns all my "customers" from my database.
> Now if I limit this result to lets say about 20-100 customers it works
> just fine. But if I try to get a large result like lets say 1000+ from
> my DB (containing 7000) I get a timeout error / nothing is shown. Is
> there a problem with extbase fetching large results from the repository
> or is it the fault of my server/ configuration?
It depends how large/complex your object graph is. Did you try to
configure lazy loading by annotationg the properties holding related
object with "@lazy"? See the property "posts" of the "Blog" in the Blog
Example.
If that does not solve your problem, try to fetch the raw query results
by setting
$rawResult = $query->getQuerySettings()->setReturnRawQueryResult(TRUE);
and map only a subset if necessary by saying
$dataMapper->map('Tx_MyExt_Domain_Model_TargetClass', $susetOfRawResult);
The Data Mapper is available in the Repository via
$this->persistenceManager()->getBackend->()->getDataMapper()
Regards
Jochen
--
Every nit picked is a bug fixed
More information about the TYPO3-project-typo3v4mvc
mailing list