Search in sources :

Example 1 with TransactionIsolationNotSupportedException

use of org.datanucleus.exceptions.TransactionIsolationNotSupportedException 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);
            }
        }
    }
}
Also used : TransactionIsolationNotSupportedException(org.datanucleus.exceptions.TransactionIsolationNotSupportedException) JDOImplHelper(javax.jdo.spi.JDOImplHelper) JDOUnsupportedOptionException(javax.jdo.JDOUnsupportedOptionException) Method(java.lang.reflect.Method) NucleusException(org.datanucleus.exceptions.NucleusException) Map(java.util.Map) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) HashMap(java.util.HashMap) InvocationTargetException(java.lang.reflect.InvocationTargetException) JDOException(javax.jdo.JDOException) JDOUserException(javax.jdo.JDOUserException) InvalidObjectException(java.io.InvalidObjectException) JDOFatalUserException(javax.jdo.JDOFatalUserException) NucleusException(org.datanucleus.exceptions.NucleusException) InvocationTargetException(java.lang.reflect.InvocationTargetException) TransactionIsolationNotSupportedException(org.datanucleus.exceptions.TransactionIsolationNotSupportedException) TransactionActiveOnCloseException(org.datanucleus.exceptions.TransactionActiveOnCloseException) IOException(java.io.IOException) JDOUnsupportedOptionException(javax.jdo.JDOUnsupportedOptionException) ClassNotResolvedException(org.datanucleus.exceptions.ClassNotResolvedException) JDOException(javax.jdo.JDOException)

Aggregations

IOException (java.io.IOException)1 InvalidObjectException (java.io.InvalidObjectException)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 ConcurrentHashMap (java.util.concurrent.ConcurrentHashMap)1 JDOException (javax.jdo.JDOException)1 JDOFatalUserException (javax.jdo.JDOFatalUserException)1 JDOUnsupportedOptionException (javax.jdo.JDOUnsupportedOptionException)1 JDOUserException (javax.jdo.JDOUserException)1 JDOImplHelper (javax.jdo.spi.JDOImplHelper)1 ClassNotResolvedException (org.datanucleus.exceptions.ClassNotResolvedException)1 NucleusException (org.datanucleus.exceptions.NucleusException)1 TransactionActiveOnCloseException (org.datanucleus.exceptions.TransactionActiveOnCloseException)1 TransactionIsolationNotSupportedException (org.datanucleus.exceptions.TransactionIsolationNotSupportedException)1