Bug #537
closedSQL error when first insert a new record into xml_replication table
0%
Description
When we first time to insert a server into xml_replication table from web
browser by sneding a get command line
(http://pine.nceas.ucsb.edu/servlet/replication?action=servercontrol&server=devx%x%
subaction=add&replicate=1
it always get a error in metacat:
java.sql.SQLException: ERROR: Cannot insert a duplicate key into unique index
xml_replication_pk
But if you try again, the error will not happen. So It always happend in the
first time to insert a new xml_replication table.
Updated by Jing Tao over 22 years ago
In xmltables.sql, When creating xml_replication table, a entry for local host
was added. the line looks like:
INSERT INTO xml_replication (serverid, server, replicate, datareplicate, hub)
VALUES ('1', 'localhost', '0', '0', '0');
But serverid is primary key and it is auto sequence number. I though if we
force to add 1 for serverid will cause problem.
When I remove it, the error is gone.