Hello.
I am experiencing problem when trying to delete items.
The first is if an item is mapped to another collection. When this is
the case, an exception is thrown and the item not deleted. Unmapping the
item and then deleting it fixes this issue. Should this not be happening
automatically on an item delete?
The second occurs due to the relationship that exists between tables
"item" and "communities2item". The error that get thrown in this case is:
ERROR: update or delete on table "item" violates foreign key constraint
"communities2item_item_id_fkey" on table "communities2item" Detail: Key
(item_id)=(13512) is still referenced from table "communities2item".
Reading through the code
(./dspace-api/src/main/java/org/dspace/content/Item.java), I came across
the following:
***********************************************************************************************************
// Remove from browse indices, if appropriate
/** XXX FIXME
** Although all other Browse index updates are managed through
** Event consumers, removing an Item *must* be done *here*
(inline)
** because otherwise, tables are left in an inconsistent state
** and the DB transaction will fail.
** Any fix would involve too much work on Browse code that
** is likely to be replaced soon anyway. --lcs, Aug 2006
**
** NB Do not check to see if the item is archived - withdrawn /
** non-archived items may still be tracked in some browse tables
** for administrative purposes, and these need to be removed.
**/
// FIXME: there is an exception handling problem here
try
{
// Remove from indices
IndexBrowse ib = new IndexBrowse(ourContext);
ib.itemRemoved(this);
}
catch (BrowseException e)
{
log.error("caught exception: ", e);
throw new SQLException(e.getMessage(), e);
}
***********************************************************************************************************
Am I right in assuming that this is where the "Collection2Item" table
should be prepared for the deletion?
Kind Regards.
Shaun
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
DSpace-tech mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-tech
List Etiquette: https://wiki.duraspace.org/display/DSPACE/Mailing+List+Etiquette