2011年3月8日星期二

Re: [fw-db] Programmatically Clear Metadata Cache?

You can save cache to registry or get it from bootstrap as it is the same
instance as in table if that comes handy for you.
---
Regards,
Saša Stamenković


On Tue, Mar 8, 2011 at 7:49 PM, JB Christy <jbchristy@pacbell.net> wrote:

> Thanks for your helpful reply. Hopefully I can figure out how to call that
> $table->getDefaultMetadataCache()->clean() at the right time / in the
> right context.
>
> -JB
>
>
> ------------------------------
> *From:* Саша Стаменковић <umpirsky@gmail.com>
>
> *To:* JBChristy <JBChristy@pacbell.net>
> *Cc:* fw-db@lists.zend.com
> *Sent:* Mon, March 7, 2011 10:57:20 PM
>
> *Subject:* Re: [fw-db] Programmatically Clear Metadata Cache?
>
> You can set table metadata cache with
>
> $cache = Zend_Cache::factory(...);
> Zend_Db_Table_Abstract::setDefaultMetadataCache($cache);
>
> and clear cache with
>
> $cache->clean(...);
>
> when the metadata changes.
>
> ---
> Regards,
> Saša Stamenković
>
>
> On Mon, Mar 7, 2011 at 10:40 PM, JBChristy <JBChristy@pacbell.net> wrote:
>
>> I've just up automatic (mem)caching of all Zend_DB_Table's. From time to
>> time, of course, the metadata changes. We do this in our production
>> environment by running sql scripts that add / drop / change columns as
>> necessary. I need some programmatic way to expire the metadata cache after
>> the sql runs, and no later than when updated code goes live, which is a
>> matter of minutes. I can't just wait til it times out.
>>
>> I've dug into Zend 1.11 Zend_Db_Table_Abstract, and the memcache key is an
>> md5 encoding of an optional port, optional host, dbname, schema name and
>> table name. There does not appear to be member function to expire the
>> cache,
>> nor even a function to return the md5 encoded key so I can delete it
>> manually.
>>
>> How are we supposed to clear the metadata cache when the metadata changes?
>>
>> Thanks in advance for your help!
>>
>> --
>> View this message in context:
>> http://zend-framework-community.634137.n4.nabble.com/Programmatically-Clear-Metadata-Cache-tp3340068p3340068.html
>> Sent from the Zend DB mailing list archive at Nabble.com.
>>
>
>

没有评论: