[infinispan-issues] [JBoss JIRA] Updated: (ISPN-333) Cache Loader Class Instantiated Twice

Manik Surtani (JIRA) jira-events at lists.jboss.org
Wed Jan 20 07:53:53 EST 2010


     [ https://jira.jboss.org/jira/browse/ISPN-333?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Manik Surtani updated ISPN-333:
-------------------------------

    Workaround Description: Configure your cache programmatically
             Fix Version/s: 4.1.0.ALPHA1
                            4.1.0.GA
                Complexity: Low
                Workaround: [Workaround Exists]


>From my comment on the forum:

"Aha, I see the problem.  Note that this only happens if you construct a CacheManager using an XML file or InputStream, which is why it never turned up in my tests (I used a GlobalConfiguration and Configuration bean, configured programmatically).
 
The issue is that each CacheStore impl has a corresponding CacheStoreConfig impl, which has knowledge of settings specific to the CacheStore impl in question.  When configuring stuff programmatically, you simply create a new instance of the CacheStoreConfig impl and pass it to the Configuration (e.g., a new FileCacheStoreConfig). 
 
But when you do this via XML, all CacheStore settings are maintained using <property ... /> tags.  So we need to know what type of CacheStoreConfig to instantiate and pass these properties to.  And the mechanism currently in place to do this is to instantiate the CacheStore implementation and call CacheStore.getConfigurationClass().  The CacheStore instance is then thrown away since the cache hasn't started yet (this is still at a much earlier phase, of parsing XML).
 
In summary, I will reopen ISPN-333 and investigate how this can be improved, but this is low prio since the first instantiation happens on startup and has no effect or cost to runtime performance."

> Cache Loader Class Instantiated Twice
> -------------------------------------
>
>                 Key: ISPN-333
>                 URL: https://jira.jboss.org/jira/browse/ISPN-333
>             Project: Infinispan
>          Issue Type: Bug
>          Components: Loaders and Stores
>    Affects Versions: 4.0.0.GA
>            Reporter: Amin Abbaspour
>            Assignee: Manik Surtani
>            Priority: Minor
>             Fix For: 4.1.0.ALPHA1, 4.1.0.GA
>
>
> Cache Loader Class Instantiated Twice. Place a static counter in the constructor and see this happen. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the infinispan-issues mailing list