Hi,
My take on sqlobject caching is this:
1. If you want to cache values, set the sqlmeta cacheValues to True.
2. If you don't want to cache values, set cacheValues to False.
3. However, if you don't cache values, you have the following behavior:
a. if you do a select, e.g.,
recs = MyClass.select()
(and a subsequent de-referencing, like list(recs))
the system will issue a db request, obtaining the entire record set,
including values for every column in the schema.
This is what is desired.
b. However, whenever you do something like rec.element, in order to
reference a single element from a previously obtained record, the system
will issue *another* db request to re-fetch the value for the column (in
this case, "element") for that record.
This is *not* what is desired.
That is, if I fetch an entire record from a fresh db request, for
subsequent accessing of individual attributes of that record, I *do not*
want db requests to be made.
How do you configure sqlobject to give this behavior?
This is especially important for web requests with multi-processes like
prefork apache. On each new http request, if you desire a record, you
would like to always issue a fresh db request. But once you have a
record, you don't want to issue new db requests for each individual
element access (during the course of processing that http request).
Many thanks if you can shed some light on these mysteries.
David Geller
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss