On 05/23/11 16:27, Adriano dos Santos Fernandes wrote:
> On 23/05/2011 09:21, Alex Peshkoff wrote:
>> Yes of cause.
>> I agree with all this words - but mentioned cache will anyway remain
>> always empty in fbclient of FB3.
>> And I do not say it must not be done - I say only that this is not top
>> priority job.
>>
> Ok, but there is a design question. How the problem with unloaded 
> modules will be fixed.
>
> Also the current code received a function and does not base the cache 
> key on it, hence second code asking for it with a different function 
> will crash.

OK, let's provide a plan. Certainly, function (or better vtable of a
class containing it), used to upgrade interface must go into the cache key.

There are 2 problematic cases here - one when a module which exported
interface is unloaded, next is when a module which imported interface
and therefore provided an upgrading class. When any of modules is
unloaded, upgrade record should be removed from cache. At once notice
that builtin modules (fbclient library and using it executable) do not
affect removing records from cache.

The best tag for a module is a pointer to IPluginModule, which must be
created by each plugin module and registered using registerModule(). We
can add getModule() function  to IVersioned, which will be called by
upgradeInterface() when adding record to the cache. What is a bit more
problematic is how to pass calling module tag to upgradeInterface(). I
do not want additional parameter - this is one of frequently called
methods. May be replacing last parameter with
class IUpgradeMethod
{
public:
    virtual void FB_CARG errorReturn(IStatus* s) = 0;
    virtual IPluginModule* FB_CARG getCallerTag() = 0;
};
is good way to go?


------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to