Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Exception on saving userproperty on Versionable in operationParticipant

 Hi

I want to save a string on a file/folder on delivery, implemented in an operationparticipant. My code is quite simple:
IVersionable item = (IVersionable) iVersionable.getWorkingCopy();
item.setUserProperty("<Keystring>", "<valuestring>");
getService(IRepositoryItemService.class).saveItemInTxn(item);
On the saveoperation, I get an exception:

ERROR com.ibm.team.process.common                         - Access violation in component item service.  Service component: com.ibm.team.repository.service, 
		
Model component: com.ibm.team.scm, 
		
Item type: com.ibm.team.filesystem#FileItem
		
com.ibm.team.repository.common.InternalRepositoryException: Access violation in component item service.  Service component: com.ibm.team.repository.service, Model component: com.ibm.team.scm, Item type: com.ibm.team.filesystem#FileItem
		
at com.ibm.team.repository.service.internal.ComponentRepositoryItemService.checkComponentPermission(ComponentRepositoryItemService.java:141)
		
at com.ibm.team.repository.service.internal.ComponentRepositoryItemService.saveItemInTxn(ComponentRepositoryItemService.java:659)
		
at dk.bankdata.rtc.extensions.contributors.FileUserPropertyCreator.createUserDefinedPropertyOnChanges(FileUserPropertyCreator.java:82)
		
at dk.bankdata.rtc.extensions.contributors.FileUserPropertyCreator.run(FileUserPropertyCreator.java:50)
		
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
		
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
		
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
		
at java.lang.reflect.Method.invoke(Method.java:600)
		
.......

I have suspect the componentid on the extensionservice is causing the failure. It is set to componentId="com.ibm.team.repository.service". But if it is wrong, I don't know a better value (I've tried several).

...and by the way: I plan to use the userproperty, assuming it is ment for users to set in customization. Is that true or am I abusing something?

Regards

Erling

0 votes

Comments

Hi Erling, I am not sure about the context of the operation. There are several things that can prevent this from working.
One is the service. There is an IScmService and I am not sure the IRepositoryItemService can do the save you want.
I searched the SDK for setUserProperty() as a method and there are several ways of how it is used, also containing save operations, which are usually done on an IWorkspaceConnection using the IWorkspaceConnection.configurationOpFactory().save(). I assume the call you are doing is not allowed in the context.


Accepted answer

Permanent link
 Just a followup to say this was implemented in RTC 5.0.2.  Here's a link to more information:
https://jazz.net/downloads/rational-team-concert/releases/5.0.2?p=news
Ralph Schoon selected this answer as the correct answer

0 votes


3 other answers

Permanent link
Versionables can only be saved via a commit operation. See IScmService#batchCommit. I am not sure If properties behave as you would like. They are baked Into the version.

1 vote


Permanent link
As John says, currently, a version property is part of the state of a version, and cannot be modified once that version is created by the checkin operation.  I've created work item 220897, requesting support for modifiable version properties ( https://jazz.net/jazz/resource/itemName/com.ibm.team.workitem.WorkItem/220897 ).

0 votes


Permanent link
 Actually my need is to put a property value on a particular version of the versionable. In my case always the last (and current version).

Perhaps it was possible to set a version property on checkin. But can it be done in a server trigger?

0 votes

Comments

My need is to set a user property on a version of an item, and to be able to modify it later (after the item is delivered).

So the workitem Geoffrey made for this is still valid .

To put a property on an artifact, you will have to put it there in a change set that is not complete and later deliver.
If you want to be able to put information on a version of an artifact that is already delivered, since 5.0.2 there are "Attributes" that ýou can define and that can be changed without the need to a new version.

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,938

Question asked: Aug 02 '12, 9:10 a.m.

Question was seen: 5,667 times

Last updated: Jan 06 '16, 5:55 a.m.

Confirmation Cancel Confirm