Bugs item #2102580, was opened at 2008-09-09 13:08
Message generated for change (Settings changed) made by mdiggory
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=2102580&group_id=19984
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Handles
Group: 1.5.1
>Status: Closed
>Resolution: Accepted
Priority: 5
Private: No
Submitted By: Mark Diggory (mdiggory)
Assigned to: Mark Diggory (mdiggory)
Summary: Duplicate Handle exception when replacing bitstreams
Initial Comment:
One of our developers (William Hays) uncovered the solution to this problem
being the removal of code from Item.delete() that removed the handle from the
handle table. I've restored this code and it will be in 1.5.1.
===========
Index: src/main/java/org/dspace/content/Item.java
===================================================================
--- . (revision 3081)
+++ . (working copy)
@@ -1872,6 +1872,15 @@
// remove all of our authorization policies
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
DatabaseManager.delete(ourContext, itemRow);
===========
-Mark
On Aug 26, 2008, at 8:00 AM, rramos wrote:
I also get this issue on 1.5.0 production version. Any one knows if this
was fixed ?
Karo Salminen wrote:
Hi,
there might be something to be resolved in ImportItem in 1.5 alpha. At
least, I'm experiencing problems when importing and trying to replace a
previously submitted item (using the same handle).
I was running 'import -r -e [EMAIL PROTECTED] -c 123456789/9 -s 123456789/9 -m
dspace.map' after exporting the same collection from DSpace and making
some changes to a items, and got the following error from PostgreSQL. I
was got no errors whatsoever when exporting and replacing items in
similar manner with DSpace 1.4.1.
"...
Bitstream: marc.bib
Processing handle file: handle
read handle: '123456789/10'
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique
constraint "handle_handle_key"
at
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1512)
at
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1297)
at
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:188)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:430)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:346)
at
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:300)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at
org.apache.commons.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
at
org.dspace.storage.rdbms.DatabaseManager.execute(DatabaseManager.java:1263)
at
org.dspace.storage.rdbms.DatabaseManager.update(DatabaseManager.java:624)
at
org.dspace.handle.HandleManager.createHandle(HandleManager.java:197)
at
org.dspace.content.InstallItem.installItem(InstallItem.java:114)
at
org.dspace.app.itemimport.ItemImport.addItem(ItemImport.java:667)
at
org.dspace.app.itemimport.ItemImport.addItems(ItemImport.java:510)
at org.dspace.app.itemimport.ItemImport.main(ItemImport.java:417)
org.postgresql.util.PSQLException: ERROR: duplicate key violates unique
constraint "handle_handle_key" "
--
Karo Salminen
sovellussuunnittelija Systems Analyst
Kirjastoverkkopalvelut National Library Network Services
Kansalliskirjasto National Library of Finland
PL 26 (Teollisuuskatu 23)
00014 Helsingin yliopisto
puh. (09) 191 44593
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel
--
View this message in context:
http://www.nabble.com/Facing-postgresql-problems-when-replacing-items-with-import-%28only-in-1.5-alpha%29-tp13876908p19163766.html
Sent from the DSpace - Devel mailing list archive at Nabble.com.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=119984&aid=2102580&group_id=19984
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Dspace-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dspace-devel