use of javax.jdo.spi.JDOImplHelper in project datanucleus-api-jdo by datanucleus.
the class JDOPersistenceManagerFactory method freezeConfiguration.
/**
* Freezes the current configuration.
* @throws JDOException if the configuration was invalid or inconsistent in some way
*/
protected void freezeConfiguration() {
if (isConfigurable()) {
// Check for invalid javax.jdo properties by calling JDOImplHelper method (new in JDO3.1+)
Method m = null;
try {
m = JDOImplHelper.class.getDeclaredMethod("assertOnlyKnownStandardProperties", new Class[] { Map.class });
m.invoke(null, nucleusContext.getConfiguration().getPersistenceProperties());
} catch (InvocationTargetException ite) {
if (ite.getCause() instanceof JDOException) {
throw (JDOException) ite.getCause();
}
} catch (JDOException jdoe) {
throw jdoe;
} catch (Exception e) {
// Method not present so continue
}
synchronized (this) {
try {
// Initialise the NucleusContext
nucleusContext.initialise();
// Set up the Level 2 Cache
datastoreCache = new JDODataStoreCache(nucleusContext.getLevel2Cache());
setIsNotConfigurable();
} catch (TransactionIsolationNotSupportedException inse) {
throw new JDOUnsupportedOptionException(inse.getMessage());
} catch (NucleusException ne) {
throw NucleusJDOHelper.getJDOExceptionForNucleusException(ne);
}
}
}
}
Aggregations