[ 2102580 ] William Hays: Duplicate Handle exception when replacing bitstreams

http://sourceforge.net/tracker/index.php?func=detail&aid=2102580&group_id=19984&atid=119984

git-svn-id: http://scm.dspace.org/svn/repo/branches/dspace-1_5_x@3112 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Mark Diggory
2008-09-09 20:09:45 +00:00
parent 3905221423
commit aa6776c2cf

View File

@@ -1873,6 +1873,15 @@ public class Item extends DSpaceObject
// remove all of our authorization policies // remove all of our authorization policies
AuthorizeManager.removeAllPolicies(ourContext, this); AuthorizeManager.removeAllPolicies(ourContext, this);
// Remove any Handle
// FIXME: HandleManager should provide a way of doing this.
// Plus, deleting a Handle may have ramifications
// that need considering.
DatabaseManager.updateQuery(ourContext,
"DELETE FROM handle WHERE resource_type_id= ? " +
"AND resource_id= ? ",
Constants.ITEM,getID());
// Finally remove item row // Finally remove item row
DatabaseManager.delete(ourContext, itemRow); DatabaseManager.delete(ourContext, itemRow);
} }