Hi, > > The idea is to cache the return value from $set, similar to the way > that DBIx::Ddatabase can use !SaveAs to cache the database parsing. > The question is, "Does it gain me anything?" The only drawback I've > run across so far is that the I have to explicitly call Flush if I > want things written out right away. Are there any others?
I can not think of any drawbacks right now. Instead of calling Flush it's a better idea to call $set -> ReleaseRecords, that does the Flush and frees up all memory of cached records. I would move the conditional that checks the cache to the top of the routine. If your recordset is already in the cache, you don't need to do anything else, just return it. Your database object should be already created and saved when the recordset object was created. In case you need your database object, you can retrive it with DBIx::Database -> Get ($saveasname) ; What do you gain? You don't save any database access, because DBIx::Recordset already caches a lot of things internaly (e.g. all metadata about the db is only retrived once), but you save the setup time for the object (creating the internal data structures). Depending on how much sets you have, this may count. Gerald ------------------------------------------------------------- Gerald Richter ecos electronic communication services gmbh Internetconnect * Webserver/-design/-datenbanken * Consulting Post: Tulpenstrasse 5 D-55276 Dienheim b. Mainz E-Mail: [EMAIL PROTECTED] Voice: +49 6133 925131 WWW: http://www.ecos.de Fax: +49 6133 925152 ------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
