[infinispan-dev] ISPN-1374 and ModuleProperties, static collections and class loading

Sanne Grinovero sanne at infinispan.org
Thu Sep 15 19:09:41 EDT 2011


On 15 September 2011 17:25, Galder Zamarreño <galder at redhat.com> wrote:
>
> On Sep 14, 2011, at 5:53 PM, Sanne Grinovero wrote:
>
>> On 14 September 2011 17:37, Manik Surtani <manik at jboss.org> wrote:
>>>
>>> On 13 Sep 2011, at 00:03, Sanne Grinovero wrote:
>>>> For example, I suspect that you won't be able to deploy an Hibernate
>>>> Search application (or Infinispan Query) and then deploy a Hibernate
>>>> OGM based application in the same container.
>>>> But this is not proven as I didn't try it out, so maybe my assumptions
>>>> about what the goal of this classloader parameter are wrong.
>>>
>>> Ah ok, I think I see your problem: that some infinispan modules are bundled with an application, using an application-scoped class loader (a web app)?  Ok, I can see how that could be a problem then.
>>
>> Exactly the point. Unless you can make sure that both OGM and Search
>> are included in AS7 and special purpose caches are pre-configured out
>> of the box :-)
>>
>>>
>>>> So I think that, iff we need to cache this information, it shouldn't
>>>> be cached in a static field, as discussed as well on
>>>
>>> Well, the purpose of caching this info is to prevent each new named Cache from re-reading module properties.  Each named cache only reads these properties once at startup, so caching this is useless if this isn't shared across named caches.  Or perhaps we maintain one such module cache per class loader passed in?
>>
>> Since caches can be started only once and should happen in the context
>> of a startCaches( ... ) context, such a cache could live in the scope
>> of such an invocation.
>> Besides solving the (potential?) problem that would also save some
>> memory as this information would be released right after usage.
>
> Remember that a cache could be restarted...

Since it's just caching class/resources information we can re-scan in
any case you would need it.

But in which cases should a cache be restarted? shouldn't it be better
to throw away the CacheManager and create a new one?
I'm assuming you can't restart a single cache while maintaining the
others available as that would break 1) asymmetric clusters limitation
2) requirement to start them all together.

Cheers,
Sanne



More information about the infinispan-dev mailing list