I found the SEQUENCE_VALUE_ITEM table, and the entry for ContactMech had the correct next key. It looks like for some reason, ContactMech or TelecomNumber is not using that to create the next sequence correctly. I guess for now, I'll just keep hitting save until I get to 10042. Hopefully it will save then and reset the counter its using.
-Tim -----Original Message----- From: Boyden, Timothy [mailto:[email protected]] Sent: Saturday, December 23, 2017 2:37 PM To: [email protected] Subject: Entity ID key counter not reset after import from XML Using Release 16.11.03... Working on an instance of OFBiz on my home computer. Imported 40 TelecomNumber records from my work computer. Went to create a new TelecomNumber record, and get: The Following Errors Occurred: Exception thrown while creating the "newValue" GenericValue: org.apache.ofbiz.entity.GenericEntityException: Error while inserting: [GenericEntity:ContactMech][contactMechId,10031(java.lang.String)][contactMechTypeId,TELECOM_NUMBER(java.lang.String)][createdStamp,2017-12-23 14:33:09.744(java.sql.Timestamp)][createdTxStamp,2017-12-23 14:33:09.657(java.sql.Timestamp)][lastUpdatedStamp,2017-12-23 14:33:09.744(java.sql.Timestamp)][lastUpdatedTxStamp,2017-12-23 14:33:09.657(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO dbo.CONTACT_MECH (CONTACT_MECH_ID, CONTACT_MECH_TYPE_ID, INFO_STRING, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?) (Violation of PRIMARY KEY constraint 'PK_CONTACT_MECH'. Cannot insert duplicate key in object 'dbo.CONTACT_MECH'. The duplicate key value is (10031).)) (Error while inserting: [GenericEntity:ContactMech][contactMechId,10031(java.lang.String)][contactMechTypeId,TELECOM_NUMBER(java.lang.String)][createdStamp,2017-12-23 14:33:09.744(java.sql.Timestamp)][createdTxStamp,2017-12-23 14:33:09.657(java.sql.Timestamp)][lastUpdatedStamp,2017-12-23 14:33:09.744(java.sql.Timestamp)][lastUpdatedTxStamp,2017-12-23 14:33:09.657(java.sql.Timestamp)] (SQL Exception while executing the following:INSERT INTO dbo.CONTACT_MECH (CONTACT_MECH_ID, CONTACT_MECH_TYPE_ID, INFO_STRING, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?) (Violation of PRIMARY KEY constraint 'PK_CONTACT_MECH'. Cannot insert duplicate key in object 'dbo.CONTACT_MECH'. The duplicate key value is (10031).))) The next key value should have been reset to 10041 after the import, but it wasn't. Is there a quick way for me to reset the next key value? Thanks, Tim
