use of org.h2.schema.SchemaObject in project ignite by apache.
the class GridH2Table method removeChildrenAndResources.
/**
* {@inheritDoc}
*/
@SuppressWarnings("ThrowableResultOfMethodCallIgnored")
@Override
public void removeChildrenAndResources(Session ses) {
lock(true);
try {
super.removeChildrenAndResources(ses);
// Clear all user indexes registered in schema.
while (idxs.size() > sysIdxsCnt) {
Index idx = idxs.get(sysIdxsCnt);
if (idx.getName() != null && idx.getSchema().findIndex(ses, idx.getName()) == idx) {
// This call implicitly removes both idx and its proxy, if any, from idxs.
database.removeSchemaObject(ses, idx);
// We have to call destroy here if we are who has removed this index from the table.
if (idx instanceof GridH2IndexBase)
((GridH2IndexBase) idx).destroy(rmIndex);
}
}
if (SysProperties.CHECK) {
for (SchemaObject obj : database.getAllSchemaObjects(DbObject.INDEX)) {
Index idx = (Index) obj;
if (idx.getTable() == this)
DbException.throwInternalError("index not dropped: " + idx.getName());
}
}
database.removeMeta(ses, getId());
invalidate();
} finally {
unlock(true);
}
}
Aggregations