{
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())