private void dropIndexSafe(String indexName) throws SqlJetException { if (null == indexName || "".equals(indexName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "Index name must be not empty"); if (!indexDefs.containsKey(indexName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "Index not found: " + indexName); if (doDropIndex(indexName, false, true)) { db.getOptions().changeSchemaVersion(); indexDefs.remove(indexName); } }
private void dropTriggerSafe(String triggerName) throws SqlJetException { if (null == triggerName || "".equals(triggerName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "Trigger name must be not empty"); if (!triggerDefs.containsKey(triggerName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "Trigger not found: " + triggerName); final SqlJetTriggerDef triggerDef = (SqlJetTriggerDef) triggerDefs.get(triggerName); final ISqlJetBtreeSchemaTable schemaTable = openSchemaTable(true); try { schemaTable.lock(); try { db.getOptions().changeSchemaVersion(); if (!schemaTable.goToRow(triggerDef.getRowId()) || !TRIGGER_TYPE.equals(schemaTable.getTypeField())) throw new SqlJetException(SqlJetErrorCode.CORRUPT); final String n = schemaTable.getNameField(); if (null == n || !triggerName.equals(n)) throw new SqlJetException(SqlJetErrorCode.CORRUPT); schemaTable.delete(); } finally { schemaTable.unlock(); } } finally { schemaTable.close(); } triggerDefs.remove(triggerName); }
private void dropViewSafe(String viewName) throws SqlJetException { if (null == viewName || "".equals(viewName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "View name must be not empty"); if (!viewDefs.containsKey(viewName)) throw new SqlJetException(SqlJetErrorCode.MISUSE, "View not found: " + viewName); final SqlJetViewDef viewDef = (SqlJetViewDef) viewDefs.get(viewName); final ISqlJetBtreeSchemaTable schemaTable = openSchemaTable(true); try { schemaTable.lock(); try { db.getOptions().changeSchemaVersion(); if (!schemaTable.goToRow(viewDef.getRowId()) || !VIEW_TYPE.equals(schemaTable.getTypeField())) throw new SqlJetException(SqlJetErrorCode.CORRUPT); final String n = schemaTable.getNameField(); if (null == n || !viewName.equals(n)) throw new SqlJetException(SqlJetErrorCode.CORRUPT); schemaTable.delete(); } finally { schemaTable.unlock(); } } finally { schemaTable.close(); } viewDefs.remove(viewName); }
schemaTable.lock(); try { db.getOptions().changeSchemaVersion();
schemaTable.lock(); try { db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();
db.getOptions().changeSchemaVersion();