Unico Hommes wrote:

Carsten Ziegeler <cziegeler <at> s-und-n.de> writes:



It seems this is due to the move to JCS :(

The logicsheet is put into the cache and JCS casts this to
Serializable in org.apache.jcs.access.CacheAccess.put().

So, what do we do now...




Yes, JCS requires objects to implement Serializable (quite acceptable
requirement for a cache ). The same problem occurred with Pagesheet from the
Paginator transformer. I've made both Logicsheet and Pagesheet implement
Serializable. Alternatively we could let the JCSStore implementation check
whether the object to store implements Serializable and if not wrap the object
in a Serializable wrapper (at the cost of some performance). After all, the
Store interface takes Object types, not Serializables.



!!!!! A LogicSheet cannot be Serializable !!!!!

It extends AbstractLogEnabled and has attributes of type ServiceManager and SourceResolver, which aren't serializable !

Furthermore, I don't understand why LogicSheets go to JCS since the transient store is used (see AbstractMarkupLanguage.service())

Don't have much time ATM, but looking at the recent changes I see a JCSTransientCache. We must be *very careful* with transient cache being actually transient, i.e. *not requiring objects to be serializable*.

If JCS requires objects to be serializable even without a persistent backend, so let's *not use it* for the transient cache, and keep the previous MRU memory store.

And please, please, do not make Serializable objects that intrinsically are not. This is the root of many evils.

Sylvain

--
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }



Reply via email to