cancel
Showing results for 
Search instead for 
Did you mean: 

String Exception while updating record in MDM 5.5 SP4

Former Member
0 Kudos

Hi All,

The below code line catalog.UpdateRecord is throwing StringException when I use this multiple times at the same time for the same record. Say when I use this piece 3 times then it may fail once at this line while the two other instances will be successful. This piece works fine if we use it multiple times provided there is a time gap between each call.

A2iFields customerFields = new A2iFields();		
		try 
		{
			customerFields = addLookupField(catalog, customerFields, "MDM_FORM_ACTION", "Form_Action_id", "NS", "Form_Action");
			int custRID = getRecordID(catalog, custTN, "ID", refCustID + "");
			int changeStamp = getChangeStamp(catalog, custTN, custRID);
			catalog.UpdateRecord(custTN, custRID, changeStamp, customerFields);			
		} 
		catch (StringException e1) 
		{		
			e1.printStackTrace();
		}

The exception trail goes as below. The line number 694 is the catalog.UpdateRecord line above.

a2i.core.StringException: Error updating record#

at a2i.common.CatalogData.UpdateRecord(Unknown Source)#

at a2i.common.CatalogData.UpdateRecord(Unknown Source)#

at com.bp.cmd.ejb.DefaultPartnerBean.updateSOFormAction(DefaultPartnerBean.java:694)#

at com.bp.cmd.ejb.DefaultPartnerBean.createPartner(DefaultPartnerBean.java:292)#

at com.bp.cmd.ejb.DefaultPartnerLocalLocalObjectImpl0.createPartner(DefaultPartnerLocalLocalObjectImpl0.java:103)#

Any thoughts on this. Will this be a result of some "lock" on the MDM record, or unable to read the changestamp of the record simultaneously to update the record. Please share your thoughts.

Thanks,

KN.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi!

Check the "custRID" most likely you are providing wrong Id for a particular record that is why you will get negative value in ChangeStamp.MDM Java API's works only with Internal ID's.Also if you delete one record physically from MDM then it's internal ID is available for re-use for the next new record.

Regards,

Mandeep

Former Member
0 Kudos

Hi Mandeep,

As noted in the question I am updating the same record multiple times at the same time with this same code set. This fails to update in one of those instances while other updates are good.

The "custRID" is the record ID of the main record that you are updating. Is it possible that the changestamp value is invalid when another instance of the code set is updating the same record at the same time.

Please share your thoughts.

Thanks,

KN.

Former Member
0 Kudos

Hi!

MDM is single thread system,so possiblity of multiple updates at the same time does not exist,moreover while updating MDM puts lock on the record in repository.

As you mentioned you are updating the same record multiple time,Is it done inside loop ?

Just try putting some time limit between two updates,there might be a possibility that your first update statement is not executed fully and second update comes,since MDM had put the lock on record for first update hence record ID is not available for second update therefore changeStamp is negative for second record.

Seems little complex to understand this behavior,but you can give it a try.

Regards,

Mandeep.

Former Member
0 Kudos

Hi Mandeep,

Thank you for the prompt reply.

This piece of code set is in a web service which is called by PI to update a main record, if multiple main records are created linking to this record. This works perfectly if there is a time gap between each updates.

I was assuming that there would be some kind of lock on the MDM at the time of update which results in giving a invalid change stamp value. Can you point me to any document which explains how catalog.UpdateRecord works so that I can confirm that this is because of internal lock on the record?

Thanks,

KN.

Former Member
0 Kudos

Hi!

You can search in import server documents,I'm not sure whether you'll find this in document.

But,I know for sure MDM puts a lock while updating records,you can test this if you have a data

manager client.Try updating 1000-2000 records ,till the time updation is going on MDM will

not allow you to work on those records.

Similarly while importing large set of records we face this issue.

Hope this helps.

Regards,

Mandeep,

Answers (0)