Package javax.jdo

Examples of javax.jdo.JDOUnsupportedOptionException


    public void setIsolationLevel(String level)
    {
        assertNotCommitting();
        if (tx.isActive() && !tx.getOptimistic())
        {
            throw new JDOUnsupportedOptionException("Cannot change the transaction isolation level while a datastore transaction is active");
        }

        PersistenceManagerFactory pmf = pm.getPersistenceManagerFactory();
        if (!pmf.supportedOptions().contains("javax.jdo.option.TransactionIsolationLevel." + level))
        {
            throw new JDOUnsupportedOptionException("Isolation level \"" + level + "\" not supported by this datastore");
        }

        int isolationLevel = TransactionUtils.getTransactionIsolationLevelForName(level);
        tx.setOption(org.datanucleus.Transaction.TRANSACTION_ISOLATION_OPTION, isolationLevel);
    }
View Full Code Here


        {
            return new org.datanucleus.jdo.exceptions.TransactionNotActiveException(jpe.getMessage(), jpe);
        }
        else if (jpe instanceof NucleusUnsupportedOptionException)
        {
            return new JDOUnsupportedOptionException(jpe.getMessage(), jpe);
        }
        else if (jpe instanceof DatastoreReadOnlyException)
        {
            ClassLoaderResolver clr = ((DatastoreReadOnlyException)jpe).getClassLoaderResolver();
            try
View Full Code Here

                configurable = false;
            }
            catch (TransactionIsolationNotSupportedException inse)
            {
                throw new JDOUnsupportedOptionException(inse.getMessage());
            }
            catch (NucleusException jpe)
            {
                throw NucleusJDOHelper.getJDOExceptionForNucleusException(jpe);
            }
View Full Code Here

        assertConfigurable();

        if (omfContext != null && omfContext.getStoreManager() != null &&
            !omfContext.getStoreManager().getSupportedOptions().contains("TransactionIsolationLevel." + level))
        {
            throw new JDOUnsupportedOptionException("Isolation level \"" + level + "\" is not supported for this datastore");
        }

        // Reset to "read-committed" if passed in as null
        setProperty("datanucleus.transactionIsolation", level != null ? level : "read-committed");
    }
View Full Code Here

TOP

Related Classes of javax.jdo.JDOUnsupportedOptionException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.