8.7 Working with Type Objects

When you create an attribute type, a hyperlink type, or a label type, you can make the type shared or unshared. By default, the type is unshared, which means that instances of the type can be created only at the replica that masters the type object. If you define the type object to be shared, instances of the type can be created at any replica in the VOB family.

For more information about type objects, see Type Object Mastership.

Creating a Shared Type Object

To create a shared type object, use the -shared option with the mkattype, mkhltype, or mklbtype command. For example, to create a shared attribute type:

cleartool mkattype -shared -c "testing status" TESTED
Created attribute type "TESTED".

Listing Whether a Type Object Is Shared or Unshared

On Windows, the Properties Browser displays the kind of mastership on the Mastership tab.

The describe command includes the kind of mastership in its output:

cleartool describe attype:TESTED
attribute type "TESTED"
created 15-Aug-00.14:23:27 by Susan Goechs (susan.user@minuteman)
master replica: boston_hub@/vobs/dev
instance mastership: shared
...

You can also use the -fmt option to display the kind of mastership. For example, to list the mastership kind of a single type object:

cleartool describe -fmt "%n\t%[type_mastership]p\n" attype:TESTED
TESTED shared

To list the mastership kind of all label types in a VOB replica:

cleartool lstype -fmt "%n\t%[type_mastership]p\n" -kind lbtype
BACKSTOP shared
BANGALORE_BASE unshared
BUENOSAIRES_BASE unshared
CHECKEDOUT shared
LATEST shared
BOSTON_BASE unshared
SANFRAN_BASE unshared
V1.0 unshared
V2.0 unshared

Converting an Unshared Type Object to a Shared Type Object

You can convert an unshared attribute type, hyperlink type, or label type to be shared. For example, if a project manager at the San Francisco site creates an unshared attribute type called TESTED_BY, but the Bangalore project manager also needs to use this type, you can convert the type to shared so both project managers can create instances of the type.

NOTE: You cannot convert a shared type object to unshared. To restrict instance creation of a type to one site, remove all instances of the type, remove the type, and create a new unshared type.

For information about using the Properties Browser on Windows to convert an unshared type object to a shared type object, see the MultiSite online help:

  1. Click Start > Programs > Rational ClearCase Administration > MultiSite Help.

  2. On the Contents tab of the Help Contents Window, click Administrator Tasks > To change a type to have shared mastership.

To use the command line to convert an unshared type object to a shared type object:

  1. Determine which replica masters the type object:

  2. cleartool describe attype:TESTED_BY@/vobs/stage
    attribute type "TESTED_BY"
    created 03-Oct-00.10:29:06 by John Cole (jcole.user@goldengate)
    master replica: sanfran_hub@/vobs/dev
    instance mastership: unshared
    ...

  3. At the master replica, enter a mk**type -replace -shared command to replace the definition of the type:

  4. cleartool mkattype -replace -shared -c "needed at multiple sites" TESTED_BY
    Replaced definition of attribute type "TESTED_BY".

  5. Export an update packet to the other sites that must use the type:

  6. multitool syncreplica -export -fship bangalore boston_hub
    ...

  7. At the receiving sites, import the update packet:

  8. multitool syncreplica -import -receive
    ...

  9. At the receiving sites, confirm that the type object is shared:

  10. cleartool describe -fmt "%n\t%[type_mastership]p\n" \
    attype:TESTED_BY@/vobs/dev

    TESTED_BY shared