Multithreaded Applications - Teradata Meta Data Services

Teradata Meta Data Services Programmer Guide

Teradata Meta Data Services
Release Number
English (United States)
Last Update
Product Category
Teradata Tools and Utilities

Multithreaded Applications

On Windows, you can create an application with multiple threads accessing the MDS APIs. The MDS objects are thread-safe at the class level but not at the object level. This means that you can have two separate threads manipulating two different CMetaObject objects, but not two threads manipulating the same CMetaObject object. If you have multiple threads manipulating the same object, you must protect the access with Win32 synchronization mechanisms.

Each thread must call the Initialize or SignOn function. Only the users who have Initialized or Signed On in the thread will have permission to objects in the thread.

Each thread will have a separate ODBC connection to the Teradata Database Systems. Along with this, MDS transactions are maintained per thread. Therefore, if your application is using MDS transactions, you must maintain thread affinity. You cannot issue a BeginTransaction and WriteObject on one thread and another WriteObject and Commit on another.