[infinispan-dev] [jboss-as7-dev] AS7-4007 missing Infinispan dependency for clustered JPA second level cache
Jason T. Greene
jason.greene at redhat.com
Tue Mar 6 15:23:59 EST 2012
On 3/6/12 1:02 PM, Galder Zamarreño wrote:
>
> On Mar 6, 2012, at 6:31 PM, Paul Ferraro wrote:
>> To summarize:
>> The fundamental issue is that Infinispan uses the same marshaller instance for all caches within a cache manager - which doesn't map cleanly to our use case, which uses a cache instance per application - thus requires cache-grained marshalling configuration.
>
> Well, this is not exactly correct since 5.0. Internally, we differentiate between a global marshaller and a per-cache marshaller. What's the difference? The classloader with which they're configured.
>
> Since 5.0, you can configure the classloader to use per cache. You can even configure the classloader per invocation with cache.with(cl)….
>
> If that's not helping you, we were wasting our time when we did this...
Read this, as it explains in detail how serialization and a multi
classloader (e.g. a modular) environment related to serialization:
https://community.jboss.org/wiki/ModularSerialization
When running in AS7 *EVERYTHING* that serializes classes that can come
from multiple classloaders (e.g. user deployments) *MUST* use the
ModularClassResolver.
Specifying a classloader per cache using cache.with() is *NOT* useful
for deserializing data in a modular environment like AS7. This has all
of the problems described in the above wiki. The .with() feature is
useful if a user is developing a custom classloader, *which is not one
our own* (hence modularclassresolver wouldnt know what to do with it).
It would also be potentially useful outside of AS7, or standalone. Based
on Pauls comments, it sounds like it is useful in allowing the user to
specify custom cache loaders, that we take advantage of, but that is a
non-serialization use case.
--
Jason T. Greene
JBoss AS Lead / EAP Platform Architect
JBoss, a division of Red Hat
More information about the infinispan-dev
mailing list