I think there are several problems with the cache implementations :
* ObjectCacheDefaultImpl
This cache uses soft references for storing objects,
but not for the keys so they stay in the map forever.
The key for a garbaged soft reference is only removed
when the same object is looked up in the cache. I modified the
ObjectCacheDefaultImpl to link soft references
to a Queue, and clear garbaged keys everytime the
cache is accessed. It ensure that no needed Identity
objects will be kept after the object has been garbaged.
These remarks also apply to ObjectCachePerBrokerImpl
and ObjectCacheLocalDefaultImpl but i did not changed
them.
* ObjectCacheSoftImpl
This is a good cache implementation. It uses a lru map
with a fixed number of hard references to objects and
a hashmap containing soft references, cleaned with a
queue associated to these soft references.
This is only available with JDK 1.4.
I changed the FixSizedLinkedHashMap from JDK 1.4 to
the org.apache.commons.collections.map.LRUMap
to remove the dependency on JDK 1.4.
I also added the proper constructor so that this cache
is usable. As the Properties object given to the
cache constructor is always null (see ObjectCacheFactory),
i made the cache implements the Configurable interface to
be able to configure the number of entries in the lru map.
* ObjectCacheJCSImpl
The JCS cache documentation states that it is a good
practice for performance to use strings instead of
objects for keys. As the string representation of
an Identity is unique, it modified the code to
use oid.toString() as keys instead of oid ?
As I cannot send attached files to this list, i will send three
mails one for each cache implementation to the mailing list.
I also have field converters for:
Calendar <-> java.sql.Date
Calendar <-> java.sql.Timestamp
List<Integer> <-> varchar
List<String> <-> varchar
List<java.sql.Time> <-> varchar
Note that the List<String> <-> varchar converter is very
similar to the StringVector3VarcharFieldConversion provided
in OJB, but the last one do forbid the use of certain charachter
(#) in stored strings. The one i have permit such values.
Cheers,
Guillaume
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]