Welcome to the Jazz Community Forum
Intermittent Exception from IItemManager.fetchCompleteItem

IBaselineHandle baselineHandle = (IBaselineHandle) IBaseline.ITEM_TYPE.createItemHandle(UUID.valueOf(baselineUuid), null);
teamRepository.itemManager().fetchCompleteItem(baselineHandle, IItemManager.REFRESH, progressMonitor);
Here is the exception:
com.ibm.team.repository.common.ItemNotFoundException: CRJAZ0215I The following recordwas not found in the database: com.ibm.team.scm.common.internal.impl.BaselineHandleImpl@1dbe1dbe (stateId: null, itemId: [UUID _7iGVEhMXEeK55MckdS-9yw], origin: <unset>, immutable: <unset>)
Are there situations that could cause an item to appear not to exist?
Accepted answer

- If the UUID is for a snapshot, you should be using IBaselineSetHandle, not IBaselineHandle. It's possible that using the wrong type results in inconsistent behaviour, e.g. if the in-memory item caches don't check the item type so it works if the item is in the cache, but fails if reading from the DB (or vice versa).
- You're running with different user ids at different times, and the visibility of the snapshot is such that it's visible to one user but not the other.
Comments

Thanks for the response! I'm going to play around with the code per your suggestion in #1. Regarding #2, we are using the same user ID both for snapshot creation and snapshot lookup, so I think that we can rule that out.

This appears to have addressed the issue. We have not seen the intermittent exception after making this change. We've given it several days of run time so far without issue.
Comments
Kirk Vogen
Oct 22 '12, 10:49 a.m.