public void drop(boolean purgeOnCommit) throws StandardException
{
//
//Like create table we say we are writing before we read the dd
dd.startWriting(lcc);
FileInfoDescriptor fid = getInfo();
if (fid == null)
throw StandardException.newException(SQLState.LANG_FILE_DOES_NOT_EXIST, sqlName,schemaName);
if (SanityManager.DEBUG)
{
if (id != null && !fid.getUUID().equals(id))
{
SanityManager.THROWASSERT("Drop id mismatch want="+id+
" have "+fid.getUUID());
}
}
String dbcp_s = PropertyUtil.getServiceProperty(lcc.getTransactionExecute(),Property.DATABASE_CLASSPATH);
if (dbcp_s != null)
{
String[][]dbcp= IdUtil.parseDbClassPath(dbcp_s,
lcc.getIdentifierCasing() != lcc.ANTI_ANSI_CASING );
boolean found = false;
//
//Look for the jar we are dropping on our database classpath.
//We don't concern ourselves with 3 part names since they may
//refer to a jar file in another database and may not occur in
//a database classpath that is stored in the propert congomerate.
for (int ix=0;ix<dbcp.length;ix++)
if (dbcp.length == 2 &&
dbcp[ix][0].equals(schemaName) && dbcp[ix][1].equals(sqlName))
found = true;
if (found)
throw StandardException.newException(SQLState.LANG_CANT_DROP_JAR_ON_DB_CLASS_PATH_DURING_EXECUTION,
IdUtil.mkQualifiedName(schemaName,sqlName),
dbcp_s);
}
try {
notifyLoader(false);
dd.invalidateAllSPSPlans();
DependencyManager dm = dd.getDependencyManager();
dm.invalidateFor(fid, DependencyManager.DROP_JAR, lcc);
dd.dropFileInfoDescriptor(fid);
fr.remove(JarDDL.mkExternalName(schemaName, sqlName, fr.getSeparatorChar()),
fid.getGenerationId(), true /*purgeOnCommit*/);
} finally {
notifyLoader(true);
}
}