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, with some restrictions if you are using global types (see Additional Restrictions for Shared Global Types).

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

Determining 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 only 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 a Type Object from Unshared to Shared

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 and the Bangalore project manager also needs to use it, you can convert the type to shared.

Note: You cannot convert a shared type object to unshared. To restrict instance creation of a type to one replica, you must 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 Help.

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 mkobjecttype –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 and send an update packet to the other replicas that must use the type:
  6. multitool syncreplica –export –fship bangalore boston_hub
    ...
  7. At the receiving replicas, import the update packet:
  8. multitool syncreplica –import –receive
    ...
  9. At the receiving replicas, 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