ReadObjectWithLock - Teradata Meta Data Services

Teradata Meta Data Services Programmer Guide

Product
Teradata Meta Data Services
Release Number
15.00
Language
English (United States)
Last Update
2018-09-28
Product Category
Teradata Tools and Utilities

ReadObjectWithLock

Purpose

ReadObjectWithLock reads in the current version of an object from the repository into the instantiated CMetaObject. ReadObjectWithLock differs from ReadObject in that it acquires all database locks necessary to both read and write the object. For a subsequent WriteObject on this object, this will prevent a deadlock caused by lock upgrades. This function should always be used within an explicit transaction to retain the locks since locks are maintained until the transaction commits or rolls back.

Requirements

The class ID (internal or globally unique) and object name or the object ID (internal or globally unique) must be set before calling ReadObjectWithLock.

Note: The order of evaluation to determine the object to be read is: (1) internal object ID if not zero; (2) global object ID if not null; (3) internal class ID and name if the internal class ID is not zero; and (4) global class ID and name

Syntax

HRESULT ReadObjectWithLock();