initial docs for cache integration #7

Merged
merged 2 commits into from Sep 27, 2012

Projects

None yet

5 participants

@lsmith77
Doctrine member

No description provided.

@lsmith77
Doctrine member

i guess once doctrine/common-documentation#7 is merged we should link to it from these docs.

@pborreli

thank you @lsmith77 👍

Without this doc it was hard to figure out that you have to close the cursor in order to make the cache works.

Same for the need of fetching all the resultset. fetch didn't work => fetchAll worked.

@marijn marijn commented on the diff Sep 23, 2012
en/reference/caching.rst
+
+In order for the data to actually be cached its necessary to ensure that the entire
+result set is read (easiest way to ensure this is to use ``fetchAll``) and the statement
+object is closed:
+
+::
+
+ <?php
+ $stmt = $conn->executeCachedQuery($query, $params, $types, new QueryCacheProfile(0, "some key"));
+ $data = $stmt->fetchAll();
+ $stmt->close() // at this point the result is cached
+
+
+.. warning::
+
+ When using the cache layer not all fetch modes are supported.
@marijn
marijn Sep 23, 2012

I guess most importantly, this should state which ones are and which ones are not.

@lsmith77
lsmith77 Sep 24, 2012

feel free to send me a PR to add this information :)

@marijn
marijn Sep 24, 2012
@stof
stof Sep 27, 2012

@lsmith77 could you update this point before this PR is merged ?

@lsmith77
lsmith77 Sep 27, 2012

i will leave that to a later time .. but i have added the above link to make it easier for people to find out ..

@guilhermeblanco guilhermeblanco merged commit a3dc17d into doctrine:master Sep 27, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment