Collection object which allows duplicate keys
I wanted to know if there is any Collection object which allows me to store multiple values for a key.
I have the data:
key "a" - value "0"
key "a" - value "1"
key "a" - value "2"
key "b" - value "3"
key "b" - value "4"
key "c" - value "5"
Is there some collection object where I can store the above data which includes duplication of keys?
No. The values do not need to be stored twice. What I wanted to know
was if a key [say a in this case] can be repeated so as to store multiple
values [0, 1, 2] against it?Well, the solution is simple then: use a Set (no matter which one)
as the value part and collect all the (duplicate?) values in that set.
Something like this will do:public class Multi {
private Map map= new HashMap();
public void put(Object key, Object value) {
Set values= (Set)map.get(key);
if (values == null)
map.put(key, values= new HashSet());
values.put(value);
public Set get(Object key) {
return map.get(key);
}this was from the top of my head, typed in in a silly little reply box,
so no warranties apply etc. ;-)
kind regards,
Jos
Similar Messages
-
Map that allows duplicate keys
Is there a map that allows duplicate keys? The get(Object key) method will then return a Collection.
Thanks, I made my own class with some help from previous threads.
private class DuplicateMap {
private Map map = new HashMap();
public void put(Object key, Object value) {
List existing = (List)map.get(key);
if (existing == null) {
List list = new ArrayList();
list.add(value);
map.put(key, list);
} else {
existing.add(value);
public List get(Object key) {
List returnValue = (List)map.get(key);
if (returnValue == null) {
returnValue = new ArrayList();
return returnValue;
} -
Allow duplicate key & value in collection
Hello Experts,
I have once scenario where I have to store duplicate keys (string) and values (string) in Map. I tried with MultiHashMap (Apache) but it's very specific to datatype. It will only allow "string" key and "integer" value.
How can I do it? Any help will be appreciated.
Regards,
SomnathStupid question perhaps, but a regular HashMap with a String as a key and an ArrayList as a value doesn't cut it? You really NEED duplicate keys also?
EDIT: yes that is a stupid suggestion; of course you need duplicate keys when it is in fact a duplicate key/value pair that we're talking about.
It will only allow "string" key and "integer" value.When I look at the Javadoc I see it is controlled by generics, just like the regular Map type. Here, even in this very old javadoc:
http://commons.apache.org/collections/api-2.1.1/org/apache/commons/collections/MultiHashMap.html
You can see that put() takes two Object values, not a String and an Integer. -
Allow duplicate key in InfoObject/ compounding length problem
Hi all.
I try to create InfoObject with compounding key, consisting of IObj itself plus 4 compound attribs and total length of 63 symbols (max allowed is 60). Obviously, the system doesn't allow me to activate the InfoObject.
I consider to move compounds into attributes area, but don't know is it possible to allow duplicate records in InfoObject?
or
Maybe you can help me with some other advise how to manage this compound key limitation?
additional info:
The InfoObject is the "copy" of source system master data tableHi,
ok, now I see. Well there is a restriction that the keyfields as in your example shouldn't be longer than 60 characters (summed up). So you need to think about using another object as compound. Isn't that possible? Another option might be to post the data to a ods/dso first which has your object as well as the compounding attributes as keyfields and which was already recommended, and after that, post the value to a new infoobject which gets it's unique value from a number range object that you need to define specially for this purpose. Add the keyfields of that ods/dso as navigational characteristics to that new object.
regards
Siggi -
PT 8.51 Upgrade - How to find duplicate keys for Portal Registry Structure?
I am upgrading peopletools for two applications (CRM 9.00 and FDM 9.00) from the 8.48.10 to 8.51.11 versions.
For CRM, Task 4-15-9 Completing the Peopletools Conversion ran app engine PTUPGCONVERT ran smoothly.
For FDM, I have the following error messages:
The Navigation Pagelet does not exist. Portal = EMPLOYEE. Object = PT_SC_PGT_MAIN_MENU. Collection = PT_PTPP_PORTAL_ROOT (219,2083)
Message Set Number: 219
Message Number: 2083
Message Reason: The Navigation Pagelet does not exist. Portal = EMPLOYEE. Object = PT_SC_PGT_MAIN_MENU. Collection = PT_PTPP_PORTAL_ROOT (219,2083)
Duplicate key. Portal: EMPLOYEE, Obj Name: PT_SC_PGT_MAIN_MENU, Nodename: LOCAL_NODE, URL: s/WEBLIB_PTPP_SC.HOMEPAGE.FieldFormula.IScript_SCP (133,4)
PT_SC_PGT_MAIN_MENU already exists. (96,3)
Copy of the Main Menu Pagelet From PS_SITETEMPLATE to Portal: EMPLOYEE failed. (219,2111)
Message Set Number: 219
Message Number: 2111
Message Reason: Copy of the Main Menu Pagelet From PS_SITETEMPLATE to Portal: EMPLOYEE failed. (219,2111)
I checked table PSPRSMDEFN which does not have an entry for PT_SC_PGT_MAIN_MENU, under the Employee Portal. I tried to migrate the missing Portal Registry object using App Designer but again receive the "duplicate key" error.
So it seems that I have to find the duplicate key and resolve it before I can migrate the missing object.
Anyone know a quick way to figure out what the duplicate keys are?
ThanksI tried several things to find the duplicates with no success.
A couple of workarounds were attempted that resulted in the same "duplicate key" error, including:
a) Re-copying file project PPLTLS84CUR
b) Copy object 'PT_SC_PGT_MAIN_MENU" from Demo
After opening an SR, the successful workaround was to use Data Mover to export from Demo the "EMPLOYEE" portal entries for "PT_SC_PGT_MAIN_MENU" from tables PSPRSMDEFN, PSPRSMSYSATTR and PSPRSMSYSATTRVL. The import to the target upgrade environment was successful. A re-run of PTUPGCONVERT finished successfully.
The upgrade is progressing but where the duplicate keys are is still a mystery.
Cheers -
Hi
I have a collection object which is contains strings like (Name Address City State Country). The collection object is created from a result set. I am not sure how to parse into respective variable for the UI to display. As of now, I am just dumping the whole collection into a SINGLE textarea. The strings are NOT delimited.
TIAThanks for your response.
To begin with I am a newbie. I have 5 columns from a table being returned by the java class as a collection. Once i get the collection which is made of variable
(name, address city, country). I need to seggregate into respective text field in my UI.
The following is what being returned from the result set.
rs = ps.executeQuery();
while (rs.next()){
String S_S1 = rs.getString("NAME");
String S_S2 = rs.getString("ADDRESS");
String S_S3 = rs.getString("CITY");
String S_S4 = rs.getString("COUNTRY");
Double S_D1 = new Double(rs.getDouble("FAXNO"));
String S_S5 = rs.getString("CMNTS");
// HERE rv0 is declared as an object with these variables (if I could say so)
rv0 = new DBData(S_S1, S_S2, S_S3, S_S4, S_D1, S_S5);
// rv is a collection, this class returns a collection
rv.add(rv0);
The following is the what have after the data is retrieved
DBGetConv dbg = new DBGetConv();
Collection data = dbg.getData(UOMSLCT); // here getData is a method insde the class DBGetConv which returns the collection.
Iterator iter = data.iterator();
Now all have is an iterator which contains a few strings and a double, all i need is to parse those and load into their respective textareaS.
HTH -
HashMap type object that allows multiple duplicate keys
Hello all,
I need an object that will allow me to have a key/value similar to a HashMap except that it will allow me to have duplicate keys.
ie....
//set(Key,Value)
set("Apple","red")
set("Apple","green")
set("Apple","brown")Any Ideas?
TIA!Nevermind,
I figured it out.
if(!map.containsKey(key))
ArrayList arraylist = new ArrayList();
arraylist.add(value);
map.put(key,arraylist);
else
ArrayList arraylist = (ArrayList) map.get(key);
arraylist.add(value);
}Thanks. -
We have been seeing the following 'warnings' in the event log of our BizTalk machine since upgrading to BTS 2006. They seem to occur randomly 6 or 8 times per day.
Does anyone know what this means and what needs to be done to clear it up? we have only one BizTalk server which is running on only one machine.
I am new to BizTalk, so I am unable to find how many tracking host instances running for BizTalk server. Also, can you please let me know that we can configure only one instance for one server/machine?
Source: BAM EventBus Service
Event: 5
Warning Details: Execute batch error. Exception information: TDDS failed to batch execution of streams. SQLServer: bizprod, Database: BizTalkDTADb.Cannot insert duplicate key row in object 'dta_MessageFieldValues'
with unique index 'IX_MessageFieldValues'. The statement has been terminated..Other than ensuring that there exists a separate and single tracking host instance, you're getting an error about duplicate keys.. which implies that you're trying to Create a BAM Activity twice with the same data.
I suggest you have a in-depth examination of the BAM (TPE or API) associated with the orchestration. In TPE ensure that the first binding you select is the "Instance Id" or "Message Id" before going ahead to map the ports or others.
Regards. -
I have migrated my SCCm 2007 environment to SCCM 2012 SP1 CU4.
I noticed in the System Status\Component Status\SMS_STATE_SYSTEM a lot of errors like the one below:
Microsoft SQL Server reported SQL message 2627, severity 14: [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of PRIMARY KEY constraint 'DeploymentSummary_PK'. Cannot insert duplicate key in object 'dbo.DeploymentSummary'. The duplicate key value is (1, 0, S0220438, 0). : spUpdateClassi
Please refer to your Configuration Manager documentation, SQL Server documentation, or the Microsoft Knowledge Base for further troubleshooting information.
When looking up the deployment ID and recreate the Deployment the problem is solved. But I have 700 packages and don't want to manually do this action on all packages. I think it is related to the migration i did and something went wrong there :-(
Besides it will retriggers the deployment to the clients which is also not preferred.
Is there another way to solve this by e.e.g do something directly in the SQL database tables ?Hi,
It is not supported by Microsoft that do something directly in SQL database.
If you want to do that, you could make a call to CSS.
Best Regards,
Joyce
We
are trying to better understand customer views on social support experience, so your participation in this
interview project would be greatly appreciated if you have time.
Thanks for helping make community forums a great place. -
Sybase Error 2601 Attempt to insert duplicate key row in object with unique
RE: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
Hi Folks,
I'm getting the following error whilst executing a stored procedure in Sybase.
ERROR: Sybase Error 2601 Attempt to insert duplicate key row in object with unique index.
I understand that duplicate values have been inserted into a column that has a unique constraint.
I just can't figure out how to rectify the problem.
Your help will be greatly appreciated!
Many thanks in advance.If the value I'm trying to insert (using update)
already exists in the unique-value field then the DB
refuses to update the field.
If the value is different it will update.Are you trying to insert or update in SQL (identified by the keyword INSERT or UPDATE respectively)?
Even in case of an UPDATE query, if you are going to update the values of some columns to violate the unique constraints, the update will not succeed and you will get the error message.
or is it?
it tries to create a new row, but can't because there
is another row with the same unique-values.
If this is the case, I am only trying to update and
not create a new item.To put it in simpler words, if you have a set of values defining the uniqueness of a record, you cannot insert another record with the same set of unique values. Similarly, you cannot update an existing record by modifying the set to conflict with another set of unique values which already exist in the database.
Suppose there are two columns A and B defining the uniqueness of the record and you have only two records at the moment like -
A B
========
1 1
2 1
If you try to insert a record with A = 1 and B = 1, it will fail because a record already exists. You cannot violate uniqueness because the database has already been told that there will be only one record for any given combination of A and B.
Similarly, if you try to update the second record from A = 2 to A = 1, the end result would be A =1 and B = 1. There is already a record with that set of values and this will result in a violation of the uniqueness. So, this update will also be disallowed. On the other hand, if you try to update B to some value, say 3, there is no problem in doing so.
For convenience, you can imagine an UPDATE operation to be equivalent to DELETE + INSERT operation, though it doesn't necessarily work the same way internally.
I hope I was clear enough. -
Cannot insert duplicate key in object 'dbo.CultureObjectStrings'
Hi Everyone,
No matter what instance I chose to run the Tasks function on the Installer I get this error:
Violation of UNIQUE KEY constraint 'IX_CultureObjectStrings'.
Cannot insert duplicate key in object 'dbo.CultureObjectStrings'
The statement has been terminated.
The Tasks Utility stops at 'Initialize Languages'. When I look at the CRM online I checked the Config Settings, Netpoint, Culture and it is set to English(United States).
I am running Business One SP01 Pl 06 and WebTools 6 PL04. I have created new instances and database and still get the same error when running Tasks after they have been built and synched.
What else can I do?
Thanks, ChesterHi Stephen,
Sorry, I am running SP01 PL 4 on WebTools. I am not running 'instance mode' I am running 'Tasks' mode. The reason this all started was when I got all of my customers data(databases,instance.xml,synch.xml, etc.) to run on my PC. Once everything is transfered to my PC, I run 'task' mode to insure I have the right hash and private keys assoicated with the data. When I frist started doing this procedure it worked, and I don't which levels back that was, but now it is a problem. So, when I saw this happening with the transfer of the data to my PC, I thought I'd try running 'tasks' mode on the orginal data just make sure I had everything. When I said I built new companies I used the OEC data that come with WebTools because I thought maybe it the customers data, but it didn't matter, still got the same error.
Thanks, Chester -
*** [23000][2627][Microsoft][SQL Server Native Client 11.0][SQL Server]Violation of UNIQUE KEY constraint 'ClientPushMachine_G_AK'. Cannot insert duplicate key in object 'dbo.ClientPushMachine_G'. The duplicate key value is (16777412). : sp_CP_CheckNewAssignedMachine
CCCRT::RunSQLStoredProc - Failed to execute SQL cmd exec [sp_CP_CheckNewAssignedMachine] N'xxx', 1
CCRQueueRequest::GetRequestFromQueue - Failed to execute SQL cmd sp_CP_CheckNewAssignedMachine
I get the above issue and the one below at a client site; the error started with the error below then changed to the one reported above and back to the one below. Everything is working as it should but the issues
started when one of the admins at the data-centre incorrectly applied a gpo which affected a number of service accounts (sccm inclusive) and they expired....hence reporting in sccm got broke as well as this error in the ccm.log file appeared.
Remote client install still works but I believe this error affects new client discovered by sccm, so in other words devices discovered by sccm do not get the client installed automatically....but if all access and permissions are in place...pushing out the
client to the new discovered system works, it just not done automatically, which kinda defeats one the reasons for using sccm.
I have searched the breadth of the tinternet and I can only find two technet reference to the same error - one says to edit the stored procedure on the sql server which I don't think should be done... Like Jason said and I concur....its bad joo joos.
The second suggestion, said you should select all the options in the Client Push Installation properties, I have tried this but hasn't solved the problem.
I am planning to upgrade the site to the R2 CU3 before the end of the year but I would like to resolve this error before the upgrade.
The site is currently sccm 2012 sp1
Any idea?> Resolution? sil vous plait!
MerciHi ,
Please back up the database of the SCCM site. Then run the following query against the Site DB and see how it goes.
DELETE FROM System_SMS_Resident_ARR
WHERE ItemKey IN (
SELECT ItemKey FROM vSystem_SMS_Resident_ARR
GROUP BY ItemKey
HAVING COUNT(ItemKey) > 1
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. -
Hello everyone,
I am getting the following error while importing the CRM 2013 managed solution, Does anyone have any idea regarding this, What could be the possible cause for this ?
"Violation of PRIMARY KEY constraint 'XPKLocalizedLabel'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'. The duplicate key value is (184191c0-1d6f-e411-9400-e41f13be2efc, 25a01723-9f63-4449-a3e0-046cc23a2902, 0,
Jan 1 1900 12:00AM). The statement has been terminated."
and this guids in the error message is different from organization to organization. Where it is having fix with the solution or organization ?
please help me to solve this.
Thanks in advance, VeereshHi All,
I have exported one unmanaged solution from my development CRM system and imported in to production, while importing i am getting the following error.
"Violation of PRIMARY KEY constraint 'XPKLocalizedLabel'. Cannot insert duplicate key in object 'MetadataSchema.LocalizedLabel'. The duplicate key value is (184191c0-1d6f-e411-9400-e41f13be2efc, 25a01723-9f63-4449-a3e0-046cc23a2902,
0, Jan 1 1900 12:00AM).
The statement has been terminated."
The key point i have noticed here is, recently i have updated my CRM system with server pack 1 and development organization is created after the server pack is installed and production organization is created before the server pack is installed. and
i have tried this in some other organization which is created before the server pack 1 installed it is failed there also and some organization which is created after the server pack 1 is installed it is imported successfully.
so i can see here it is not able to import solution into organization which is created before server pack 1 is installed from which is created after the server pack 1 is installed.
please help me to solve this error.
Thanks,
Veeresh
Thanks in advance, Veeresh -
Hi,
we experience with Project Server 2010 SP2 CU10/14 an issue with the WSSSync. Neither GUID1, GUID2 and GUID3 are in the table WssListItemAssociation. We tried to delete the published version of the project, relink and resync the project site, but had no
success. Any suggestions very much appreciated.
Thanks
John
General
Reporting transfer WSS links failed.:
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID4' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID5' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID6' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID7' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID8' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
ReportingWssTransferLinksFailed (24019) - Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value is (GUID1, GUID2, GUID3, 4). The statement has been
terminated.. Details: id='24019' name='ReportingWssTransferLinksFailed' uid='GUID9' Error='Violation of PRIMARY KEY constraint 'PK_MSP_WssListItemAssociation'. Cannot insert duplicate key in object 'dbo.MSP_WssListItemAssociation'. The duplicate key value
is (GUID1, GUID2, GUID3, 4). The statement has been terminated.'.
Reporting message processor failed:
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID10' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID11' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID12' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID13' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID14' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
ReportingWSSSyncMessageFailed (24016) - RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.. Details: id='24016' name='ReportingWSSSyncMessageFailed' uid='GUID15' QueueMessageBody='ProjectUID='GUID1'. ForceFullSync='False'.
SynchronizationType='Issues'' Error='RDS failed while trying to sync one or more SP lists. The RDS queue message will be retried.'.
Queue:
GeneralQueueJobFailed (26000) - ReportingWSSSync.WSSSyncMessageEx. Details: id='26000' name='GeneralQueueJobFailed' uid='GUID16' JobUID='GUID17' ComputerName='SERVER' GroupType='ReportingWSSSync' MessageType='WSSSyncMessageEx' MessageId='1' Stage=''. For more
details, check the ULS logs on machine SERVER for entries with JobUID GUID17.
JohnHi John,
Is this happening for all Projects or only one project.
Try this action plan and check
1. Open PWA -> Server Settings -> Project Sites
2. Select the site which is having issue
3. Click on the option "Edit Site Address" , Select "Remove the URL for the SharePoint Site"
4. Click on ok
5. Click on Create site and provide a new site name
7. Synchronize the project and workspace , make sure the sync jobs are successful
8. click on Delete site and remove the newly created site
9. click on Edit Site Address and Specify the old Project site URL
10. Sync the workspace
Thanks,
Phani -
Cannot insert duplicate key row in object Error Message
Morning All,
I noticed today that the DW has not been updated with some of my CI's based off my custom class.
The event log is showing these error messages.
An error countered while attempting to execute ETL Module:
ETL process type: Transform
Batch ID: 5601
Module name: TransformPeripheralDim
Message: ErrorNumber="2601" Message="Cannot insert duplicate key row in object 'dbo.PeripheralDim' with unique index 'UniqueIndex'." Severity="14" State="1" ProcedureName="TransformPeripheralDimProc" LineNumber="163" Task="Inserting into Dimension"
Stack: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at Microsoft.SystemCenter.Warehouse.Utility.SqlHelper.ExecuteReader(SqlConnection sqlCon, CommandType cmdType, String cmdText, SqlParameter[] parameters)
at Microsoft.SystemCenter.Warehouse.Etl.StoredProcedure.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
at Microsoft.SystemCenter.Warehouse.Etl.TransformModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
at Microsoft.SystemCenter.Etl.ETLModule.OnDataItem(DataItemBase dataItem, DataItemAcknowledgementCallback acknowledgedCallback, Object acknowledgedState, DataItemProcessingCompleteCallback completionCallback, Object completionState)
ETL Module Execution failed:
ETL process type: Transform
Batch ID: 5601
Module name: TransformPeripheralDim
Message: ErrorNumber="2601" Message="Cannot insert duplicate key row in object 'dbo.PeripheralDim' with unique index 'UniqueIndex'." Severity="14" State="1" ProcedureName="TransformPeripheralDimProc" LineNumber="163" Task="Inserting into Dimension"
Stack: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader()
at Microsoft.SystemCenter.Warehouse.Utility.SqlHelper.ExecuteReader(SqlConnection sqlCon, CommandType cmdType, String cmdText, SqlParameter[] parameters)
at Microsoft.SystemCenter.Warehouse.Etl.StoredProcedure.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
at Microsoft.SystemCenter.Warehouse.Etl.TransformModule.Execute(IXPathNavigable config, Watermark wm, DomainUser sourceConnectionUser, DomainUser destinationConnectionUser)
at Microsoft.SystemCenter.Etl.ETLModule.OnDataItem(DataItemBase dataItem, DataItemAcknowledgementCallback acknowledgedCallback, Object acknowledgedState, DataItemProcessingCompleteCallback completionCallback, Object completionState)
It was working fine so I'm not sure what's caused it to stop or where I can start looking to see what's causing it.
Any ideas?
Cheers,
SB
My System Center BlogJust in case it helps, this is the MP I'm using to bring the data across to the DW.
If I removed the MP from Service Manager, would that drop the tables in the DW and allow me to start again?
<ManagementPack
ContentReadable="true"
SchemaVersion="1.1"
OriginalSchemaVersion="1.1">
<Manifest>
<Identity>
<ID>AssetManagementReports</ID>
<Version>1.0.0.6</Version>
</Identity>
<Name>AssetManagementReports</Name>
<References>
<Reference
Alias="AssetManagemetListsRef">
<ID>AssetManagementLists</ID>
<Version>1.0.1.1</Version>
<PublicKeyToken>0a39b272096917b0</PublicKeyToken>
</Reference>
<Reference
Alias="AssetManagementMP">
<ID>AssetManagement</ID>
<Version>1.0.0.21</Version>
<PublicKeyToken>0a39b272096917b0</PublicKeyToken>
</Reference>
<Reference
Alias="DWBase">
<ID>Microsoft.SystemCenter.Datawarehouse.Base</ID>
<Version>7.0.5826.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
<Reference
Alias="System">
<ID>System.Library</ID>
<Version>7.0.5826.0</Version>
<PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
</Reference>
</References>
</Manifest>
<Warehouse>
<Outriggers>
<Outrigger
ID="EquipmentTypeList"
Accessibility="Public">
<Attribute
ID="EquipmentType"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/EquipmentType$"/>
</Outrigger>
<Outrigger
ID="ManufacturerList"
Accessibility="Public">
<Attribute
ID="Manufacturer"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Manufacturer$"/>
</Outrigger>
<Outrigger
ID="ModelList"
Accessibility="Public">
<Attribute
ID="Model"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Model$"/>
</Outrigger>
<Outrigger
ID="SupplierList"
Accessibility="Public">
<Attribute
ID="Supplier"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Supplier$"/>
</Outrigger>
<Outrigger
ID="DirectorateList"
Accessibility="Public">
<Attribute
ID="Directorate"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Directorate$"/>
</Outrigger>
<Outrigger
ID="DepartmentList"
Accessibility="Public">
<Attribute
ID="Department"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Department$"/>
</Outrigger>
<Outrigger
ID="SectionList"
Accessibility="Public">
<Attribute
ID="Section"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Section$"/>
</Outrigger>
<Outrigger
ID="LocationList"
Accessibility="Public">
<Attribute
ID="Location"
PropertyPath="$Context/Property[Type='AssetManagementMP!AssetManagementBaseClass']/Location$"/>
</Outrigger>
<Outrigger
ID="MobileTariffList"
Accessibility="Public">
<Attribute
ID="MobileTariff"
PropertyPath="$Context/Property[Type='AssetManagementMP!MobilePhoneNumberAsset']/MobileTariff$"/>
</Outrigger>
</Outriggers>
<Dimensions>
<Dimension
ID="PeripheralDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!Peripheral"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="MobilePhonesDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!MobilePhones"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="MobileSIMCardAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!MobileSIMCardAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="MobilePhoneNumberAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!MobilePhoneNumberAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="RemoteAccessTokenAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!RemoteAccessTokenAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="CiscoIPTelephonyAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!CiscoIPTelephonyAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="NetworkInfrastructureAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!NetworkInfrastructureAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
<Dimension
ID="ServerInfrastructureAssetDim"
Accessibility="Public"
InferredDimension="true"
Target="AssetManagementMP!ServerInfrastructureAsset"
HierarchySupport="IncludeDerivedClassProperties"
Reconcile="true"/>
</Dimensions>
<Facts>
<RelationshipFact
ID="MobiletoSIMCardFact"
Accessibility="Public"
Domain="DWBase!Domain.ConfigurationManagement"
TimeGrain="Daily"
SourceType="AssetManagementMP!MobilePhones"
SourceDimension="MobilePhonesDim">
<Relationships
RelationshipType="AssetManagementMP!MobiletoSIMCard"
TargetDimension="MobileSIMCardAssetDim"/>
</RelationshipFact>
<RelationshipFact
ID="MobiletoPhoneNumberFact"
Accessibility="Public"
Domain="DWBase!Domain.ConfigurationManagement"
TimeGrain="Daily"
SourceType="AssetManagementMP!MobilePhones"
SourceDimension="MobilePhonesDim">
<Relationships
RelationshipType="AssetManagementMP!MobiletoPhoneNumber"
TargetDimension="MobilePhoneNumberAssetDim"/>
</RelationshipFact>
<RelationshipFact
ID="MobilePhoneNumberToSIMCardFact"
Accessibility="Public"
Domain="DWBase!Domain.ConfigurationManagement"
TimeGrain="Daily"
SourceType="AssetManagementMP!MobilePhoneNumberAsset"
SourceDimension="MobilePhoneNumberAssetDim">
<Relationships
RelationshipType="AssetManagementMP!MobilePhoneNumberToSIMCard"
TargetDimension="MobileSIMCardAssetDim"/>
</RelationshipFact>
<RelationshipFact
ID="PeripheralOwnedByUserFact"
Accessibility="Public"
Domain="DWBase!Domain.ConfigurationManagement"
TimeGrain="Daily"
SourceType="AssetManagementMP!Peripheral"
SourceDimension="PeripheralDim">
<Relationships
RelationshipType="System!System.ConfigItemOwnedByUser"
TargetDimension="DWBase!UserDim"/>
</RelationshipFact>
</Facts>
</Warehouse>
<LanguagePacks>
<LanguagePack
ID="ENG"
IsDefault="true">
<DisplayStrings>
<DisplayString
ElementID="AssetManagementReports">
<Name>Asset
Management Reports</Name>
<Description>This
management pack adds an Asset Management dimension to the Data Warehouse and other items related to reporting.</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
<LanguagePack
ID="ENU"
IsDefault="false">
<DisplayStrings>
<DisplayString
ElementID="AssetManagementReports">
<Name>Asset
Management Reports</Name>
<Description>This
management pack adds an Asset Management dimension to the Data Warehouse and other items related to reporting.</Description>
</DisplayString>
</DisplayStrings>
</LanguagePack>
</LanguagePacks>
</ManagementPack>
My System Center Blog
Maybe you are looking for
-
my macbook pro goes to sleep by it does not wake up afterwards. I have to restart it. I had recently to change the board in the attached Thunderbolt display, because I noticed that the same problem arose when the display was attached. Now with the ne
-
Validation in approval workflow
Hi, I am new to OIM 11gR1. I have created one approval workflow, RequesterManagerApproval in jDeveloper. When the user raises a request, the request will go to Requester's Manager. We have to check that Requester's Manager should not be blank or disa
-
hello, i recently got two viruses on my Windows XP side. I deleted the one, but i just got the second one today. I rarely use it so i just was going to delete it because it seems to be infecting every file on there. The whole side is a wreck. So, i k
-
I THINK I have imported videos from my iPhone to my MacBook Air. but can't find them anywhere - they are not in iPhoto - which is ridiculously complex and there seems to be no logic
-
"Unable to install component is built-in"
I'm unable to install the full version of quick office in my nokia C7 it gives an error "unable to install component is built-in"....i have tried evrythin possible to delete the built in ones in vain.... i really need to install the full version as a