Transactions - 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

Transactions

Ideally, the metaxml program would perform all actions in an XML file as one transaction. With one transaction per XML file, either the entire content of the XML file would be applied to the MDS repository or every action will be rolled back. Depending on the content and size of the XML file, using one transaction can cause the following problems:

  • MDS objects can potentially be locked for a long period of time preventing other applications from accessing the MDS repository.
  • Because the metaxml program is performing multiple MDS API calls, metaxml or other MDS applications can potentially deadlock waiting for an object locked by metaxml.
  • By default, the metaxml program uses MDS implicit transactions, which commits changes after each call to a MDS API. In the MDS DTD, the following element tags have a transaction attribute: METAUSERS, METAGROUPS, SECURITYPROFILES, MODELDESC, CLASSDESC, RELATIONSHIPDESC, PROPERTYDESC, DERIVEDCLASSDESC, RELATION and OBJECT. If the element tag has a transaction attribute value to “yes”, then metaxml will begin a MDS explicit transaction and end the transaction when the element ends. For example:

    <MODEL>
    	<NAME>Model 1</NAME>
    	<CLASS>Class 1
    		<NAME>Class 1</NAME>
    		<OBJECT transaction=”yes”>													fl Start a transaction (Tx1)
    			...
    			<RELATIONSHIP>
    				<OBJECT>											fl Under transaction (Tx1)
    					<RELATIONSHIP>
    						<OBJECT transaction=”yes”>									fl Start a transaction (Tx2).  However, 
    																nested transaction is not allowed.  	
    																Under transaction Tx1.
    						</OBJECT>
    					</RELATIONSHIP>
    				</OBJECT>
    			</RELATIONSHIP>
    		</OBJECT>													fl End transaction (Tx1)
    		<OBJECT>										fl by default, implicit transaction
    		</OBJECT>
    </CLASS>