EndTransactionContext

Short Description

Terminates the transaction context for the specified TCTXT handle.

Category

Transaction context methods

Syntax

EndTransactionContext(tCtxt,resource,flags);

Parameters

Method Parameters
Parameter
Type
Direction
Description
tCtxt
string
in
Passed handle representing a server-side transaction context.
resource
string
in
Passed resource identifier for the object for which the transaction context is to be terminated, if TCTXT was obtained using a null value.
flags
int
in
SECAD_COMMIT_TC
Specifies to persist the security changes in the transaction context to the SAS Metadata Server.
SECAD_DISCARD_TC
Specifies to discard the security changes in the transaction context and cancel the security update.

Details

The EndTransactionContext method terminates the transaction context on the specified resource.
If a valid existing resource was specified when the corresponding BeginTransactionContext() method was called, then RESOURCE should be an empty string.
SECAD_COMMIT_TC and SECAD_DISCARD_TC are symbols representing the valid values for the FLAGS parameter.
  • Set SECAD_COMMIT_TC to commit changes in the transaction context before terminating the transaction context. The changes in the transaction context are written to the SAS Metadata Server as authorization metadata objects that are associated with the specified resource.
  • Set SECAD_DISCARD_TC to discard the changes.
The caller must have WriteMetadata permission on the target resource to commit the changes to the SAS Metadata Server.

Exceptions Thrown

The SAS Open Metadata Interface explicitly returns the following exceptions for the EndTransactionContext method:
  • SECAD_INVALID_TC_HANDLE
  • SECAD_INVALID_ACTION
  • SECAD_NOT_AUTHORIZED

Examples

The following code fragment shows how the EndTransactionContext method is issued in a Java environment:
public void endTransactionContext (String transCtxt, int options) throws 
Exception
	{
		try
		{
			iSecurityAdmin.EndTransactionContext (transCtxt, "", options);
		}
		catch (Exception e)
		{
			System.out.println("EndTransactionContext: Exceptions");
			e.printStackTrace();
			throw e;
		}
}
The following example issues an EndTransactionContext method to specify to commit the changes indicated in tCtxt.value:
iSecurityAdmin.EndTransactionContext(tCtxt.value, ISecurityAdmin.SECAD_COMMIT_TC);

Related Methods