It's all about the answers!

Ask a question

[closed] SCM API - Best way to find file lock status (it is currently taking longer than expected)

Eric Benzacar (41912) | asked Sep 10 '15, 1:49 p.m.
edited Oct 06 '17, 11:04 a.m. by David Lafreniere (4.8k7)

I need to use the API to determine the lock status of each file in a stream for a component.  Based on this post I see that I can use the ILockSearchCriteria to search a component/stream for IVersonableLock, but searching seems to be extremely slow.  Is there any additional indexing that I can have Jazz perform to improve on these search results, or is there a faster way to retrieve this information?

The WebUI seems to be able to quickly determine the lock status of a file (displaying a different icon) so I presume there must be a better solution.  Is there a field in the IFileItem that I can use for the lock status, and only query Jazz using ILockSearchCriteria to get detailed lock info (ie: which contributor currently has the lock)? 

In a quick test, it took me over 5mins to search for the locks on 48 files using findLocks() .  I can only imagine that significantly more files will take exponentially longer.

Chris McGee commented Sep 30 '15, 3:49 p.m.

Just out of curiosity, can I get some more details about your RTC server? What database is it using (e.g. Oracle, DB2)? Also, does this server handle a large number of users? Any idea if locks are being used frequently by you or other teams on this server?

The question has been closed for the following reason: "Additional Information Needed" by daviddl Oct 05 '17, 6:32 p.m.