Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-04-05 05:59:39 -0400
committerEike Stepper2013-04-05 05:59:39 -0400
commitb9d58c2472e3710911c7cedf791b294e3b75ba39 (patch)
tree69f4a935fdc72be28bb67def895fd9ffc29e46e1
parent5955c34d8fa9bc8ec54a93d01b24f39cf7177901 (diff)
downloadcdo-b9d58c2472e3710911c7cedf791b294e3b75ba39.tar.gz
cdo-b9d58c2472e3710911c7cedf791b294e3b75ba39.tar.xz
cdo-b9d58c2472e3710911c7cedf791b294e3b75ba39.zip
[401763] Make CDO Server more robust against data dictionary changes
https://bugs.eclipse.org/bugs/show_bug.cgi?id=401763
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
index 239c3e90d5..c00a5e6ede 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBIndex.java
@@ -23,6 +23,7 @@ import org.eclipse.net4j.spi.db.ddl.InternalDBField;
import org.eclipse.net4j.spi.db.ddl.InternalDBIndex;
import org.eclipse.net4j.spi.db.ddl.InternalDBSchema;
import org.eclipse.net4j.spi.db.ddl.InternalDBTable;
+import org.eclipse.net4j.util.om.OMPlatform;
import java.io.IOException;
import java.io.Writer;
@@ -36,6 +37,9 @@ import java.util.List;
*/
public class DBIndex extends DBSchemaElement implements InternalDBIndex
{
+ private static final boolean DISABLE_NULLABLE_CHECK = Boolean.parseBoolean(OMPlatform.INSTANCE.getProperty(
+ "org.eclipse.net4j.db.DisableNullableCheck", "true"));
+
private static final long serialVersionUID = 1L;
private IDBTable table;
@@ -112,10 +116,11 @@ public class DBIndex extends DBSchemaElement implements InternalDBIndex
{
assertUnlocked();
- if (type != Type.NON_UNIQUE && !field.isNotNull())
+ if (type != Type.NON_UNIQUE && !field.isNotNull() && !DISABLE_NULLABLE_CHECK)
{
Exception constructionStackTrace = ((InternalDBField)field).getConstructionStackTrace();
- throw new DBException("Index field is nullable: " + field, constructionStackTrace); //$NON-NLS-1$
+ throw new DBException(
+ "Index field is nullable: " + field + " (to disable this check run with '-Dorg.eclipse.net4j.db.DisableNullableCheck=true')", constructionStackTrace); //$NON-NLS-1$
}
if (field.getTable() != table)

Back to the top