Revision 6197
Added by ben leinfelder over 13 years ago
src/edu/ucsb/nceas/metacat/DocumentImpl.java | ||
---|---|---|
3267 | 3267 |
//} |
3268 | 3268 |
double afterDeleteIndex = System.currentTimeMillis()/1000; |
3269 | 3269 |
logMetacat.info("DocumentImpl.delete - The deleting xml_index time is "+(afterDeleteIndex - afterArchiveDocAndNode )); |
3270 |
|
|
3270 | 3271 |
// Now delete it from xml_access table |
3271 |
pstmt = conn.prepareStatement( |
|
3272 |
"DELETE FROM xml_access WHERE accessfileid = ?"); |
|
3273 |
pstmt.setString(1, docid); |
|
3274 |
logMetacat.debug("DocumentImpl.delete - executing SQL: " + pstmt.toString()); |
|
3275 |
pstmt.execute(); |
|
3276 |
pstmt.close(); |
|
3277 |
conn.increaseUsageCount(1); |
|
3278 |
double afterDeleteXmlAccess1 = System.currentTimeMillis()/1000; |
|
3279 |
logMetacat.info("DocumentImpl.delete - The deleting xml_access base one accessfileid time is "+(afterDeleteXmlAccess1 - afterDeleteIndex )); |
|
3280 |
pstmt = conn.prepareStatement( |
|
3281 |
"DELETE FROM xml_access WHERE docid = ?"); |
|
3282 |
pstmt.setString(1, docid); |
|
3283 |
logMetacat.debug("DocumentImpl.delete - executing SQL: " + pstmt.toString()); |
|
3284 |
pstmt.execute(); |
|
3285 |
pstmt.close(); |
|
3286 |
conn.increaseUsageCount(1); |
|
3272 |
/*************** DO NOT DELETE ACCESS - need to archive this ******************/ |
|
3273 |
// pstmt = conn.prepareStatement( |
|
3274 |
// "DELETE FROM xml_access WHERE accessfileid = ?"); |
|
3275 |
// pstmt.setString(1, docid); |
|
3276 |
// logMetacat.debug("DocumentImpl.delete - executing SQL: " + pstmt.toString()); |
|
3277 |
// pstmt.execute(); |
|
3278 |
// pstmt.close(); |
|
3279 |
// conn.increaseUsageCount(1); |
|
3280 |
// double afterDeleteXmlAccess1 = System.currentTimeMillis()/1000; |
|
3281 |
// logMetacat.info("DocumentImpl.delete - The deleting xml_access base one accessfileid time is "+(afterDeleteXmlAccess1 - afterDeleteIndex )); |
|
3282 |
// pstmt = conn.prepareStatement( |
|
3283 |
// "DELETE FROM xml_access WHERE docid = ?"); |
|
3284 |
// pstmt.setString(1, docid); |
|
3285 |
// logMetacat.debug("DocumentImpl.delete - executing SQL: " + pstmt.toString()); |
|
3286 |
// pstmt.execute(); |
|
3287 |
// pstmt.close(); |
|
3288 |
// conn.increaseUsageCount(1); |
|
3287 | 3289 |
double afterDeleteXmlAccess2 = System.currentTimeMillis()/1000; |
3288 |
logMetacat.info("DocumentImpl.delete - The deleting xml_access base on docid time is "+(afterDeleteXmlAccess2 - afterDeleteXmlAccess1 )); |
|
3290 |
// logMetacat.info("DocumentImpl.delete - The deleting xml_access base on docid time is "+(afterDeleteXmlAccess2 - afterDeleteXmlAccess1 )); |
|
3291 |
/******* END DELETE ACCESS *************/ |
|
3292 |
|
|
3293 |
|
|
3289 | 3294 |
// Delete enteries from xml_queryresult |
3290 | 3295 |
// pstmt = conn.prepareStatement( |
3291 | 3296 |
// "DELETE FROM xml_queryresult WHERE docid = ?"); |
Also available in: Unified diff
do not delete the access rules when we "archive" the document on "delete" (commented out for now)