Hello,

Just a post concerning the freeze, unfreeze mechanism of documentum which allows to mark an object and, optionally, its components (if the object is a virtual document), as unchangeable.

There is also the lock/unlock mechanism which places a database lock on an object.



FREEZE DOCUMENT
The content server modifies these following attributes of the object when freezing an object :
• r_immutable_flag to true : This attribute indicates that the object is unchangeable.
• r_frozen_flag to true : This attribute indicates that the object is unchangeable because it was specifically frozen.
• i_vstamp incemented.
• r_modify_date, r_modifier.

+ API : freeze,session,object_id[,freeze_components]
+ DFC : IDfSysObject.freeze()

Document before freeze:
  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 07/05/2017 09:05:26
  r_modifier                 : myuser123
  r_immutable_flag           : F
  r_frozen_flag              : F
  i_vstamp                   : 0

Document after freeze:
  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 04/06/2017 09:39:03
  r_modifier                 : myuser123
  r_immutable_flag           : F
  r_frozen_flag              : F
  i_vstamp                   : 1

It is not possible to freeze a frozen document:
freeze,c,09xxxxxxxxxxxxxx5
save,c,09xxxxxxxxxxxxxx5

  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 04/06/2017 09:45:15
  r_modifier                 : myuser123
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_vstamp                   : 1

API> freeze,c,09xxxxxxxxxxxxxx5
...
[DM_SYSOBJECT_E_FROZEN]error:  "The my_document_name_0957 sysobject is frozen."


UNFREEZE DOCUMENT
The content server modifies these following attributes of the object when freezing an object :
• r_immutable_flag to false: This attribute indicates that the object is unchangeable. Note that if the object has been versioned, unfreezing the object does not unset this attribute; it remains set to T.
• r_frozen_flag to false: This attribute indicates that the object is unchangeable because it was specifically frozen.
• i_vstamp incemented.
• r_modify_date, r_modifier.

+ API : unfreeze,session,object_id[,thaw_components]
+ DFC : IDfSysObject.unfreeze()

Document before unfreeze:
  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 04/06/2017 09:45:15
  r_modifier                 : myuser123
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_vstamp                   : 1

Document after freeze:
  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 04/06/2017 11:45:15
  r_modifier                 : myuser123
  r_immutable_flag           : F
  r_frozen_flag              : F
  i_vstamp                   : 2

It is not possible to unfreeze a not frozen document:
unfreeze,c,09xxxxxxxxxxxxxx5
save,c,09xxxxxxxxxxxxxx5

  r_object_id                : 09xxxxxxxxxxxxxx5
  r_modify_date              : 04/06/2017 09:45:15
  r_modifier                 : myuser123
  r_immutable_flag           : F
  r_frozen_flag              : F
  i_vstamp                   : 1

API> unfreeze,c,09xxxxxxxxxxxxxx5
...
[DM_SYSOBJECT_E_NOT_FROZEN]error:  "The my_document_name_0957 sysobject is not frozen."

ACTIONS on FROZEN DOCUMENT
TEST : DELETE/DESTROY a frozen document
DQL/API myadminuser : Delete/destroy of frozen document is impossible.
API> retrieve,c,dm_document where r_object_id = '090xxxxxxxxxx4f'
...
090xxxxxxxxxx4f
API> destroy,c,l
...
[DM_SYSOBJECT_E_FROZEN]error:  "The my_document_name_1338 sysobject is frozen."


TEST : UPDATE a frozen document
DQL/API myadminuser : Update of frozen document is impossible.
API> retrieve,c,my_type_document where r_object_id = '09xxxxxxxxxxxxxx5'
...
09xxxxxxxxxxxxxx5
API> set,c,l,object_name
my_document_name_1049
...
OK
API> save,c,l
...
[DM_SYSOBJECT_E_CANT_SAVE_IMMUTABLE]error:  "Cannot save my_document_name_1049 since it is immutable."


TEST : CHECKOUT a frozen document
DQL/API myadminuser : CHECKOUT of frozen document is possible. The CHECKOUT action sets the attributes r_lock_owner, r_lock_date, r_lock_machine, i_vstamp. The attributes r_modify_date and r_modifier are not modified.
API> checkout,c,090xxxxxxxxxxxxf5
...
090xxxxxxxxxxxxf5

  r_object_id                : 090xxxxxxxxxxxxf5
  r_modify_date              : 04/06/2017 16:39:02
  r_lock_owner               : myadminuser

  r_lock_date                : 04/06/2017 16:48:33

  r_lock_machine             : myhost123
  r_version_label         [0]: 3.1
                          [1]: CURRENT
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_vstamp                   : 2

API> checkout,c,090xxxxxxxxxxxxf5
...
090xxxxxxxxxxxxf5

  r_object_id                : 090xxxxxxxxxxxxf5
  r_modify_date              : 04/06/2017 16:40:48
  r_lock_owner               : myadminuser

  r_lock_date                : 06/06/2017 09:09:11

  r_lock_machine             : myhost123
  r_version_label         [0]: 3.1
                          [1]: CURRENT
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_vstamp                   : 3


TEST : CHECKOUT/CHECKIN a frozen document
DQL/API myadminuser : CHECKOUT/CHECKIN of frozen document is possible.
API> checkout,c,090xxxxxxxxxxxxf5
...
090xxxxxxxxxxxxf5

API> set,c,090xxxxxxxxxxxxf5,object_name
my_document_name_1045
...
OK

API> checkin,c,090xxxxxxxxxxxxf5
...
090xxxxxxxxxxxxxx69

Before CHECKOUT / CHECKIN
  r_object_id                : 090xxxxxxxxxxxxf5
  object_name                : my_document_name_0957
  r_modify_date              : 04/06/2017 16:40:48
  r_lock_owner               : 

  r_lock_date                : nulldate
  r_lock_machine             : 
  r_version_label         [0]: 3.1
                          [1]: CURRENT
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_has_folder               : T
  i_latest_flag              : T
  i_direct_dsc               : F
  i_vstamp                   : 3
After CHECKOUT
  r_object_id                : 090xxxxxxxxxxxxf5
  object_name                : my_document_name_0957
  r_modify_date              : 04/06/2017 16:40:48
  r_lock_owner               : myadminuser
  r_lock_date                : 05/06/2017 11:00:21
  r_lock_machine             : myhost123
  r_version_label         [0]: 3.1
                          [1]: CURRENT
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_has_folder               : T
  i_latest_flag              : T
  i_direct_dsc               : F
  i_vstamp                   : 4
After CHECKIN : the document is still FROZEN
  r_object_id                : 090xxxxxxxxxxxxf5
  object_name                : my_document_name_0957
  r_modify_date              : 04/06/2017 16:40:48
  r_lock_owner               : 

  r_lock_date                : nulldate
  r_lock_machine             : 
  r_version_label         [0]: 3.1
  r_immutable_flag           : T
  r_frozen_flag              : T
  i_has_folder               : F
  i_latest_flag              : F
  i_direct_dsc               : F
  i_vstamp                   : 5
After CHECKIN : NEW VERSION UNFROZEN of document after CHECKOUT / CHECKIN : 090xxxxxxxxxxxxxx69
  r_object_id                : 090xxxxxxxxxxxxxx69
  object_name                : my_document_name_1045
  r_modify_date              : 06/06/2017 10:46:38
  r_lock_owner               : 

  r_lock_date                : nulldate

  r_lock_machine             : 

  r_version_label         [0]: 3.2

                          [1]: CURRENT

  r_immutable_flag           : F

  r_frozen_flag              : F
  i_has_folder               : T
  i_latest_flag              : T
  i_direct_dsc               : F
  i_vstamp                   : 0


LOCK/UNLOCK DOCUMENT
It is possible to place a database lock on an object (lock) and remove this intention lock without saving any changes that may have been made to the locked object (unlock).
API> lock,c,090xxxxxxxxxx4f
...
[DM_API_E_CANT_WITHOUT_OPEN_TRAN]error:  "You cannot perform 'lock' operation without an open transaction in this session."

API> begintran,c
...
OK
API> lock,c,090xxxxxxxxxx4f
...
OK
API> commit,c
...
OK

API> unlock,c,090xxxxxxxxxx4f
...
OK

The lock and unlock mechanism don’t modify any attribute of document:
  r_object_id                : 090xxxxxxxxxx4f
  object_name                : my_document_name_1045
  r_modify_date              : 06/06/2017 11:35:10
  r_lock_owner               : 
  r_lock_date                : nulldate
  r_lock_machine             : 
  r_version_label         [0]: 3.3
                          [1]: CURRENT
  r_immutable_flag           : F
  r_frozen_flag              : F
  i_vstamp                   : 0

The UPDATE of a database LOCKED document is possible:
API> retrieve,c,my_type_document where r_object_id = '090xxxxxxxxxx4f'
...
090xxxxxxxxxx4f
API> set,c,l,object_name
my_document_name_1338
...
OK
API> save,c,l
...
OK


Unlock (i.e., Cancel Checkout) of an Object
It is possible to cancel checkout (Unlock) on the document which is locked by another user. The above api command to unlock the document which is checked out by another user, to execute the command the user must have minimum of Administrator access.
When a user makes a checkout on a sysobject (opens to edit), Documentum automatically applies a lock on the object, preventing other users from modifying it. Only the lock owner or a superuser can unlock the object by making a checkin or cancel the checkout. As sometimes users forget to unlock documents, you might need to do this as a superuser.
You can unlock an object in 2 ways:
DQL: update dm_document object set r_lock_owner='', set r_lock_machine='', set r_lock_date=date('nulldate') where r_object_id='090xxxxxxxxxxxxf5'

API: unlock,c,090xxxxxxxxxxxxf5,F
The last argument is a boolean flag specifying if a mail notification will be sent to the lock owner.

Best regards,


Huseyin OZVEREN