Revision 10005
Added by Jing Tao about 8 years ago
src/edu/ucsb/nceas/metacat/IdentifierManager.java | ||
---|---|---|
2311 | 2311 |
stmt.close(); |
2312 | 2312 |
|
2313 | 2313 |
// remove the smmediatypeproperties |
2314 |
query = "delete from smmediatypeproperties " +
|
|
2314 |
query = "delete from smMediaTypeProperties " +
|
|
2315 | 2315 |
"where guid = ?"; |
2316 | 2316 |
stmt = dbConn.prepareStatement(query); |
2317 | 2317 |
stmt.setString(1, guid); |
2318 |
logMetacat.debug("delete smmediatypeproperties: " + stmt.toString());
|
|
2318 |
logMetacat.debug("delete smMediaTypeProperties: " + stmt.toString());
|
|
2319 | 2319 |
rows = stmt.executeUpdate(); |
2320 | 2320 |
stmt.close(); |
2321 | 2321 |
|
2322 |
// remove the xml_access |
|
2323 |
query = "delete from xml_access " + |
|
2324 |
"where guid = ?"; |
|
2325 |
stmt = dbConn.prepareStatement(query); |
|
2326 |
stmt.setString(1, guid); |
|
2327 |
logMetacat.debug("delete xml_access: " + stmt.toString()); |
|
2328 |
rows = stmt.executeUpdate(); |
|
2329 |
stmt.close(); |
|
2330 |
|
|
2322 | 2331 |
// remove main system metadata entry |
2323 | 2332 |
query = "delete from " + TYPE_SYSTEM_METADATA + " where guid = ? "; |
2324 | 2333 |
stmt = dbConn.prepareStatement(query); |
... | ... | |
2334 | 2343 |
// Metacat keeps "deleted" documents so we should not remove access rules. |
2335 | 2344 |
|
2336 | 2345 |
} catch (Exception e) { |
2337 |
e.printStackTrace(); |
|
2338 | 2346 |
logMetacat.error("Error while deleting " + TYPE_SYSTEM_METADATA + " record: " + guid, e ); |
2339 | 2347 |
try { |
2340 | 2348 |
dbConn.rollback(); |
Also available in: Unified diff
The deleteSystemmetadata method will delete the records on xml_access as well.