Index: main/java/org/castor/cache/distributed/EHCache.java =================================================================== --- main/java/org/castor/cache/distributed/EHCache.java (Revision 6123) +++ main/java/org/castor/cache/distributed/EHCache.java (Arbeitskopie) @@ -84,6 +84,9 @@ /** The method to invoke on Element instead of calling getValue() directly. */ private Method _getValueMethod; + + /** The method to test whether or not an element is expired. */ + private Method _isExpiredMethod; /** Class instance for "net.sf.ehcache.Element" */ private Class _elementClass; @@ -137,8 +140,8 @@ try { _elementClass = Class.forName("net.sf.ehcache.Element"); - _getValueMethod = - _elementClass.getMethod("getValue", null); + _getValueMethod = _elementClass.getMethod("getValue", null); + _isExpiredMethod = _elementClass.getMethod("isExpired", null); } catch (Exception e) { String msg = "Failed to instantiate Class for type 'net.sf.ehcache.Element': " @@ -213,7 +216,9 @@ try { Object elementInCache = _getMethod.invoke(_cache, new Object[] {key}); if (elementInCache == null) { return null; } - result = _getValueMethod.invoke(elementInCache, null); + if (_isExpiredMethod.invoke(elementInCache, null) == Boolean.FALSE) { + result = _getValueMethod.invoke(elementInCache, null); + } } catch (Exception e) { String msg = "Failed to call method on EHCache instance: " + e.getMessage(); LOG.error(msg, e); Index: doc/release-notes.xml =================================================================== --- doc/release-notes.xml (Revision 6123) +++ doc/release-notes.xml (Arbeitskopie) @@ -38,6 +38,26 @@ + + + Fixed minor inconsistency in getting (expired) objects from EHCache. + + + Gregory Block + gblock@ctoforaday.com + + + Werner Guttmann + werner.guttmann@gmx.net + + + Gregory Block + gblock@ctoforaday.com + + Bug + JDO + 20060830 + Improved documentation wrt source generator Ant task. Index: etc/CHANGELOG =================================================================== --- etc/CHANGELOG (Revision 6123) +++ etc/CHANGELOG (Arbeitskopie) @@ -2,6 +2,11 @@ SVN --- +JDO: Resolved issue CASTOR-1487 using contribution from Gregory Block [gblock@ctoforaday.com] + Fixed minor inconsistency in getting (expired) objects from EHCache. + Details: http://jira.codehaus.org/browse/CASTOR-1487 + (Werner - 20060830) + XML: Resolved issue CASTOR-1512 using contribution from Werner Guttmann [werner.guttmann@gmx.net] Improved documentation of source generator Ant task. Details: http://jira.codehaus.org/browse/CASTOR-1512 @@ -13,7 +18,7 @@ (Werner - 20060824) XML: Resolved issue CASTOR-1508 using contribution from Phil Webb [phil.webb@card.co.uk] - Various speed improvementzs related to inheritance search. + Various speed improvements related to inheritance search. Details: http://jira.codehaus.org/browse/CASTOR-1508 (Werner - 20060824)