If no cacheProvideClass is given, the deploy of the
hibernate MBean fails.
I'd propose to set a default, that can be overridden by
the user.
If the following is ok,then I'd commit it.
RCS file:
/cvsroot/jboss/hibernate/src/main/org/jboss/hibernate/jmx/Hibernate.java,v
retrieving revision 1.3.2.1
diff -u -r1.3.2.1 Hibernate.java
--- Hibernate.java 20 Sep 2004 05:44:34 -0000 1.3.2.1
+++ Hibernate.java 26 Oct 2004 19:08:24 -0000
@@ -61,6 +61,9 @@
private boolean dirty = false;
private SessionFactory sessionFactory;
+
+ private static final String defaultCacheProviderClass
+ = "net.sf.hibernate.cache.HashtableCacheProvider";
/**
* @jmx.managed-attribute
@@ -516,7 +519,10 @@
setUnlessNull(props, Environment.DATASOURCE,
datasourceName);
setUnlessNull(props, Environment.DIALECT, dialect);
setUnlessNull(props,
Environment.SESSION_FACTORY_NAME, sessionFactoryName);
- setUnlessNull(props, Environment.CACHE_PROVIDER,
cacheProviderClass);
+ if (cacheProviderClass != null)
+ setUnlessNull(props,
Environment.CACHE_PROVIDER, cacheProviderClass);
+ else
+ setUnlessNull(props,
Environment.CACHE_PROVIDER, defaultCacheProviderClass);
setUnlessNull(props,
Environment.CACHE_REGION_PREFIX, cacheRegionPrefix);
setUnlessNull(props, Environment.HBM2DDL_AUTO,
hbm2ddlAuto);
setUnlessNull(props, Environment.DEFAULT_SCHEMA,
defaultSchema);
Logged In: YES
user_id=217112
After some more thinking: Shouldn't the MBean provide
defaults for all attributes if the default works with JBoss
out of the box?
I.e. use DefaultDS and Hsql-dialect if nothing provided by
the user?