*/
public void resetSchemaUsages(Activation activation, String schemaName)
throws StandardException {
Activation parent = activation.getParentActivation();
SchemaDescriptor defaultSchema = getInitialDefaultSchemaDescriptor();
// walk SQL session context chain
while (parent != null) {
SQLSessionContext ssc = parent.getSQLSessionContextForChildren();
SchemaDescriptor s = ssc.getDefaultSchema();
if (SanityManager.DEBUG) {
SanityManager.ASSERT(s != null, "s should not be empty here");
}
if (schemaName.equals(s.getSchemaName())) {
ssc.setDefaultSchema(defaultSchema);
}
parent = parent.getParentActivation();
}
// finally top level
SQLSessionContext top = getTopLevelSQLSessionContext();
SchemaDescriptor sd = top.getDefaultSchema();
if (SanityManager.DEBUG) {
SanityManager.ASSERT(sd != null, "sd should not be empty here");
}
if (schemaName.equals(sd.getSchemaName())) {
top.setDefaultSchema(defaultSchema);
}
}