Package org.datanucleus.store.exceptions

Examples of org.datanucleus.store.exceptions.DatastoreReadOnlyException


    {
        if (readOnlyDatastore)
        {
            if (getStringProperty("datanucleus.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
            {
                throw new DatastoreReadOnlyException(LOCALISER.msg("032004",
                    op.toPrintableID()), op.getExecutionContext().getClassLoaderResolver());
            }
            else
            {
                if (NucleusLogger.PERSISTENCE.isDebugEnabled())
                {
                    NucleusLogger.PERSISTENCE.debug(LOCALISER.msg("032005", op.toPrintableID()));
                }
                return;
            }
        }
        else
        {
            AbstractClassMetaData cmd = op.getClassMetaData();
            if (cmd.hasExtension("read-only"))
            {
                String value = cmd.getValueForExtension("read-only");
                if (!StringUtils.isWhitespace(value))
                {
                    boolean readonly = Boolean.valueOf(value).booleanValue();
                    if (readonly)
                    {
                        if (getStringProperty("datanucleus.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
                        {
                            throw new DatastoreReadOnlyException(LOCALISER.msg("032006",
                                op.toPrintableID()), op.getExecutionContext().getClassLoaderResolver());
                        }
                        else
                        {
                            if (NucleusLogger.PERSISTENCE.isDebugEnabled())
View Full Code Here


        PersistenceConfiguration conf = getOMFContext().getPersistenceConfiguration();
        if (conf.getBooleanProperty("datanucleus.readOnlyDatastore"))
        {
            if (conf.getStringProperty("datanucleus.readOnlyDatastoreAction").equalsIgnoreCase("EXCEPTION"))
            {
                throw new DatastoreReadOnlyException(LOCALISER.msg("032004",
                    StringUtils.toJVMIDString(sm.getObject())), sm.getObjectManager().getClassLoaderResolver());
            }
            else
            {
                if (NucleusLogger.PERSISTENCE.isDebugEnabled())
View Full Code Here

TOP

Related Classes of org.datanucleus.store.exceptions.DatastoreReadOnlyException

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.