[jbosscache-dev] CacheLoader preload with region based marshalling

Manik Surtani manik at jboss.org
Tue Sep 23 11:58:32 EDT 2008


Brian,

Looking at JBCACHE-1009, do you still see value in preloading regions  
as regions are activated?  If we do do this, there are a few things we  
need to think about:

1.  Regions being created on the fly.  E.g., in <preload> I have /.   
And no regions are created.  DefaultInactive is true.  I start the  
cache, preload / (including /a/b) and then create a new region, /a/b.   
Which is inactive.  Would this wipe state in that region?
2.  As above, but what happens to active sub-regions?
3.  Overwriting.  I create region /a and /a/b/c.  Both are preloaded.   
I now create a new region, /a/b, which is inactive on startup and I  
now activate.  I am assuming anything now in memory for /a/b would be  
erased and overwritten with state in the CL?

And this is just the start - I see a whole can of worms here.  :-)

Cheers
Manik


On 6 Jun 2008, at 10:04, Manik Surtani wrote:

>
> On 5 Jun 2008, at 13:39, Brian Stansberry wrote:
>
>> The regions are created/registered after start(); i.e. after the  
>> point shown in the logs.  This is why I think it might just be a  
>> configuration mistake that's been in AS 5 all along; just wasn't  
>> exposed due to JBCACHE-1358. (In AS 4 there is no cacheloader  
>> involved.)
>>
>> Perhaps w/ region-based marshalling I shouln't use <preload>/</ 
>> preload>. A nice fix to http://jira.jboss.com/jira/browse/JBCACHE-1009 
>>  would include logic to defer the preload until regions are  
>> activated.
>
> Yes, agreed.  And this is not necessarily overly complex to do either:
>
> When preloading stuff from cache loader:
> 1) Loop through all Fqns to be preloaded.
> 2) For each Fqn being preloaded, if any state is regionalised (i.e.,  
> a non-null region) check if the region is activated.  If so, proceed  
> as normal, if not skip.
>
> When a region is actvated:
> 1) Check if the region is a sub-region of any "preload" Fqns  
> specified in your cache loader cfg.
> 2) If so, attempt to preload that Fqn, but only for regions that  
> match the one being activated.  Skip others.
>
> I wonder if it is worth fixing JBCACHE-1009 in 2.2.0.  It would  
> warrant another CR in 2.2.0 though.  Thoughts?  Votes on this?
>
>> TBH, I don't see why I want <preload>/</preload> at all for this  
>> usage.
>
> Yes - isn't lazy loading a virtue here anyway?  :-)
>
> And re: 2.1.1.GA, since JBCACHE-1358 is an obvious bug in JBC, I may  
> port this fix to 2.1.X which will cause future 2.1.X releases to  
> break in the same way.
>
> Cheers
> Manik
> --
> Manik Surtani
> Lead, JBoss Cache
> manik at jboss.org
>
>
>
>
>
>
> _______________________________________________
> jbosscache-dev mailing list
> jbosscache-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosscache-dev

--
Manik Surtani
Lead, JBoss Cache
manik at jboss.org







More information about the jbosscache-dev mailing list