IBM Support

How to Checkout (reserved) an element that is already checked out (reserved) in another view

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:

  1. An element is checked out (reserved) in a view that still exists and you are unable to checkin the element because:
    1. The checkout is in a snapshot view (and the user is unavailable to perform the checkin or cancel the checkout).
    2. The view is inaccessible.
  2. 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 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

  1. From either ClearCase Explorer or Windows Explorer, right click on the element and select Properties of Version

    Windows Explorer example:


  2. Uncheck the Reserved check box and click OK to make the version checkedout unreserved.





Command line:

  1. Open a command prompt (Start > Run and type cmd)

  2. Set into the view and cd down to the directory where the element is located.

    Example:

    M:\>cd my_view\my_vob\docs

  3. 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:

  1. Open a command prompt (Start > Run and type cmd)

  2. CD into a view down to the directory where the element is located.

    Example:

    M:\>cd my_view\my_vob\docs

  3. 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")

  4. 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".


  5. 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")



[{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"View: Dynamic","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF015","label":"IRIX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"7.0;7.0.1;7.1;7.1.1;7.1.2","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"View: Snapshot","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSSH27","label":"Rational ClearCase"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"View: Snapshot","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
16 June 2018

UID

swg21129391