I have 2 questions regarding JBoss TreeCache usage with Hibernate
1. I'm trying to turn on caching for one of my objects and the following message appears in the log file
ERROR [org.jgroups.blocks.RpcDispatcher] exception=java.io.NotSerializableException: org.digijava.kernel.request.Site
This class is not serializable. Is it required to implement java.io.Serializable interface for Hibernate-persisted classes?
2. As I can see from the source of net.sf.hibernate.cache.TreeCache class, each item in the cache has its own FQN, while key for the object in the cache is a string "item", defined by the constant. here is the example:
Code:
public Object get(Object key) throws CacheException {
try {
return cache.get( new Fqn( new Object[] { regionName, key } ), ITEM );
}
catch (Exception e) {
throw new CacheException(e);
}
}
I'm wondering, what are the benefits of this method in comparision with the following:
Code:
public Object get(Object key) throws CacheException {
try {
return cache.get( regionFqn , key );
}
catch (Exception e) {
throw new CacheException(e);
}
}
where regionFqn = new Fqn(regionName) assignment happens in the constructor?
Thank you