Properties from a CacheModel definition are set for the next CacheModel 
definition
----------------------------------------------------------------------------------

                 Key: IBATIS-564
                 URL: https://issues.apache.org/jira/browse/IBATIS-564
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.2
         Environment: Windows
            Reporter: Carl Allain
            Priority: Minor


I use my own CacheController implementation
If I have this:
        <cacheModel id="cacheModel1" readOnly="true" serialize="false" 
type="MyAdvancedCacheController">
                <flushInterval hours="24" />
                <property name="myProperty1" value="myPropertyValue1-1" />
                <property name="myProperty2" value="myPropertyValue2-1" />
        </cacheModel>
        <cacheModel id="cacheModel2" readOnly="true" serialize="false" 
type="MyAdvancedCacheController">
                <flushInterval hours="24" />
                <property name="myProperty1" value="myPropertyValue1-3" />
        </cacheModel>

MyCacheController.setProperties(Properties props) is called with
myProperty1=myPropertyValue1-1
myProperty2=myPropertyValue2-1
for the 1st MyAdvancedCacheController instance created for cacheModel1

BUT

MyCacheController.setProperties(Properties props) is called with
myProperty1=myPropertyValue1-1
myProperty2=myPropertyValue2-1
for the 2nd MyAdvancedCacheController instance created for cacheModel2!!!

Of course, I don't expect myProperty2=myPropertyValue2-1 to be applied to the 
2nd MyAdvancedCacheController instance.

The workaround is to set a dummy property myProperty2 with a no-op value (ex: 
an empty string value) on the second CacheModel definition and handle it as a 
null in our CacheController instance.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to