Unique index problem with SQL Server

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Unique index problem with SQL Server

Vince Clark
Not sure if this is just an issue with SQL Server as there is a post on the ML regarding DB2.

I had to drop two indexes on the InventoryItem entity in order to get past the error. They are defined in the entitymodel.xml file as unique indexes.
INVITEM_SOFID
INVITEM_ACTNM

Neither of the fields these indexes are on are required. Why are unique indexes being created on fields that do not require a value?

Here is the error:



The Following Errors Occurred:

Error:<br/> Error: ERROR: Could not complete the Create an InventoryItem [file:/home/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml#createInventoryItem] process [problem creating the inventoryItem value: Error while inserting: [GenericEntity:InventoryItem][createdStamp,2009-07-09 12:51:05.881(java.sql.Timestamp)][createdTxStamp,2009-07-09 12:51:05.807(java.sql.Timestamp)][currencyUomId,USD(java.lang.String)][datetimeReceived,2009-07-09 12:50:24.953(java.sql.Timestamp)][facilityId,10000(java.lang.String)][inventoryItemId,10006(java.lang.String)][inventoryItemTypeId,NON_SERIAL_INV_ITEM(java.lang.String)][lastUpdatedStamp,2009-07-09 12:51:05.881(java.sql.Timestamp)][lastUpdatedTxStamp,2009-07-09 12:51:05.807(java.sql.Timestamp)][locationSeqId,573(java.lang.String)][ownerPartyId,10000(java.lang.String)][productId,11889(java.lang.String)][unitCost,0.5(java.math.BigDecimal)] (SQL Exception while executing the following:INSERT INTO dbo.INVENTORY_ITEM (INVENTORY_ITEM_ID, INVENTORY_ITEM_TYPE_ID, PRODUCT_ID, PARTY_ID, OWNER_PARTY_ID, STATUS_ID, DATETIME_RECEIVED, DATETIME_MANUFACTURED, EXPIRE_DATE, FACILITY_ID, CONTAINER_ID, LOT_ID, UOM_ID, BIN_NUMBER, LOCATION_SEQ_ID, COMMENTS, QUANTITY_ON_HAND_TOTAL, AVAILABLE_TO_PROMISE_TOTAL, QUANTITY_ON_HAND, AVAILABLE_TO_PROMISE, SERIAL_NUMBER, SOFT_IDENTIFIER, ACTIVATION_NUMBER, ACTIVATION_VALID_THRU, UNIT_COST, CURRENCY_UOM_ID, LAST_UPDATED_STAMP, LAST_UPDATED_TX_STAMP, CREATED_STAMP, CREATED_TX_STAMP) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Cannot insert duplicate key row in object 'dbo.INVENTORY_ITEM' with unique index 'INVITEM_SOFID'.))] calling service createInventoryItem in receiveInventoryProduct <br/> <br/>


Vince Clark
[hidden email]
(303) 493-6723