Question & Answer
Question
How can you checkout (reserved) an element that is already checked out (reserved) on the same branch in another IBM® Rational® ClearCase® snapshot or dynamic view.
Cause
One of two common scenarios is associated with this problem:
- An element is checked out (reserved) in a view that still exists and you are unable to checkin the element because:
- The checkout is in a snapshot view (and the user is unavailable to perform the checkin or cancel the checkout).
- The view is inaccessible.
- The view has been removed incorrectly leaving checked out references in the VOB.
Answer
Review the About reserved and unreserved checkouts section of the IBM Rational ClearCase Developing Software manual for a detailed explanation about reserved and unreserved checkouts.
There are two solutions to this problem:
1. Uncheckout the element(s)
- If the view exists and you do not care about losing the changes in the view
- If the view no longer exists
See technote 1122515 which provides instructions on how to remove all the checkout references from a view using the cleartool rmview -uuid command.
2. Change the checkout status of the elements(s) from reserved to unreserved
The element that is checked out reserved can be set to unreserved.
Review the ClearCase Command Reference Guide on the topic of unreserve (cleartool man unreserve) for more information.
There are two scenarios that use slightly different methods to achieve the same results. These scenarios depend on the availability of the view and the ability of a user to start and or set into the view itself.
View Available -- The view can be accessed and the checkout status can be directly changed.
View Unavailable--The view cannont be accessed directly.
VIEW IS AVAILABLE
If you can start and set into the view that has the checkouts, but do not want to checkin the data and do not want to lose the changes that were made in that view, you can simply change the reserve status directly in one of two ways:
GUI
- From either ClearCase Explorer or Windows Explorer, right click on the element and select Properties of Version
Windows Explorer example:
- Uncheck the Reserved check box and click OK to make the version checkedout unreserved.
Command line:
- Open a command prompt (Start > Run and type cmd)
- Set into the view and cd down to the directory where the element is located.
Example:
M:\>cd my_view\my_vob\docs
- Type cleartool unreserve <element_name> to change the reserve status of the checkout.
Example:
M:\my_view\my_vob\docs>cleartool unreserve bar.txt
Changed checkout to unreserved for "bar.txt" branch "\main".
VIEW UNAVAILABLE
This example would be an option for a snapshot view that is currently disconnected from the network which has changes that can't be lost.
Once the element is changed to an unreserved checkout, another view can then check the element out reserved, make changes, and then check it back in.
Command Line:
- Open a command prompt (Start > Run and type cmd)
- CD into a view down to the directory where the element is located.
Example:
M:\>cd my_view\my_vob\docs
- Type cleartool lsco -long <element_name>. This will show which view has this element checked out reserved.
Example:
M:\my_view\my_vob\docs>cleartool lsco -long bar.txt
31-Jul-02.14:17:31 user_name.group@hostname
checkout version "bar.txt" from \main\0 (reserved)
by view: user_view_with_checkout
("hostname:D:\Views\user_name\user_view_with_checkout.vws")
- Type cleartool unreserve -view <view_path> <element_name> to change the reserve status of the checkout.
Example:
M:\my_view\my_vob\docs>cleartool unreserve -view
hostname:D:\Views\user_name\user_view_with_checkout.vws bar.txt
Changed checkout to unreserved for "bar.txt" branch "\main".
- Type cleartool lsco -long <element_name> again to verify the file is listed as an unreserved checkout now.
Example:
M:\my_view\my_vob\docs>cleartool lsco -long bar.txt
31-Jul-02.14:17:31 user_name.group@hostname
checkout version "bar.txt" from \main\0 (unreserved)
by view: user_view_with_checkout
("hostname:D:\Views\user_name\user_view_with_checkout.vws")
Related Information
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21129391