sorry for double-post.
This CacheProvider will fix the problem for ehcache. I've just copied the code from 'net.sf.ehcache.hibernate.Provider' version 1.1 into the new class and added the missing methods.
I hope that's okay for the ehcache-team ;)
For me this is good enough until a new version of ehcache will follow ...
Code:
package <your package>.cache;
import net.sf.ehcache.hibernate.Plugin;
import net.sf.hibernate.cache.Cache;
import net.sf.hibernate.cache.CacheException;
import net.sf.hibernate.cache.CacheProvider;
import net.sf.hibernate.cache.Timestamper;
import java.util.Properties;
/**
* Workaround to make ehcache work with hibernate 2.1.8
*
* @author curio
*/
public class Provider implements CacheProvider {
//~ Methods ----------------------------------
/**
* @see net.sf.hibernate.cache.CacheProvider#buildCache(java.lang.String, java.util.Properties)
*/
public Cache buildCache(String name, Properties properties) throws CacheException {
return new Plugin(name);
}
/**
* @see net.sf.hibernate.cache.CacheProvider#nextTimestamp()
*/
public long nextTimestamp() {
return Timestamper.next();
}
/**
* Callback to perform any necessary initialization of the underlying cache implementation
* during SessionFactory construction.
*
* @param properties current configuration settings.
*
* @throws CacheException CacheException
*/
public void start(Properties properties) throws CacheException {
// do nothing
}
/**
* Callback to perform any necessary cleanup of the underlying cache implementation during
* SessionFactory.close().
*/
public void stop() {
// do nothing
}
}
It seems that ehcache is still working as it should ... at least i hope, because I'm quite sure, that the new methods weren't added just for fun ;)
@HB-Team
Does the ehcache-team know that the interface has changed? Can we hope for a new, fixed version?
TiA
curio