TeamRepositoryException: Cannot close change set that is not active in workspace or in suspended list
We have a custom follow up action extending the operation "com.ibm.team.scm.server.deliver" so when a delivery in to a stream occurs, then the current change sets are promoted to a "mirror" stream, too.
We used this server extension since RTC v2.0.0.2, but now that we migrated to RTC v4.0.7 an exception is thrown:
com.ibm.team.repository.common.TeamRepositoryException: Cannot close change set that is not active in workspace or in suspended listWe found this exception is thrown by "com.ibm.team.scm.service.internal.operations.CloseChangeSetsOperation" as:
if( cs.isActive() || checkActive )We tried to change the change sets status to not active as well as to close the change sets before the deliver operation, but these didn't do the trick...
throw ChangeSetUtils.COMPLETED_CHANGE_SET.createException(Messages.getString("CloseChangeSetsOperation.1"), csh); //$NON-NLS-1$
Any advice?
Thanks in advance.
2 answers
When you are making a call to close the changesets, you may be passing 'checkActive' parameter as true.
Here is a javadoc for 'checkActive' -
if <code>true</code>, checks that all of the given change sets
* are among this workspace's set of active change sets or active
* in the suspended set of the workspace. If any of them do not
* meet this criteria, throws TeamRepositoryException.
* If <code>false</code>, the check is skipped. Skipping the
* check is useful for callers that just want to ensure that a
* change set is closed, whether or not it started out as active.
May be, you should try passing this parameter as 'false'.
Should we call the service:
com.ibm.team.scm.common.IScmService#closeChangeSets
with input parameter checkActive=false, before we call the service:
com.ibm.team.scm.common.IScmService#deliverCombined
Thanks in advance.
Comments
Yes, that would be my understanding. If it still does not work for you, please submit a defect. .
Invoking the IScmService#closeChangeSets before the IScmService#deliverCombined cause a stale data exception:
CRJAZ6054E The operation cannot be run because the repository contains a newer version of the item it tried to modify. Refresh from the repository and try the operation again.