getDatabase().checkSecurity(ODatabaseSecurityResources.SCHEMA, ORole.PERMISSION_UPDATE);
acquireSchemaWriteLock();
try {
final ODatabaseRecordInternal database = getDatabase();
final OStorage storage = database.getStorage();
if (storage instanceof OStorageProxy) {
final String cmd = String.format("alter property %s mandatory %s", getFullName(), isMandatory);
database.command(new OCommandSQL(cmd)).execute();
} else if (isDistributedCommand()) {