---
name: "CosTransactions_Coordinator"
section: "3erl"
platform: "linux"
package: "erlang-manpages"
version: "1:19.2.1+dfsg-2+deb9u3"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/CosTransactions_Coordinator"
---

# CosTransactions\_Coordinator(3erl)

This module implements the OMG CosTransactions::Coordinator interface.

## NAME

CosTransactions\_Coordinator - This module implements the OMG CosTransactions::Coordinator interface.

## DESCRIPTION

To get access to the record definitions for the structures use: \
 *-include\_lib("cosTransactions/include/CosTransactions.hrl").*

## EXPORTS

**create\_subtransaction(Coordinator) -\> Control**\

Types:

Coordinator = #objref\
 Control = #objref\

A new subtransaction is created whose parent is the Coordinator argument.

Raises exception:

- \*

  'SubtransactionsUnavailable' - if nested transactions are not supported.

- \*

  'Inactive' - if target transaction has already been prepared.

**get\_transaction\_name(Coordinator) -\> Name**\

Types:

Coordinator = #objref\
 Name = string() of type "oe\_name@machine\_type\_timestamp"\

Returns a printable string, which describe the transaction. The main purpose is to support debugging.

**get\_parent\_status(Coordinator) -\> Status**\

Types:

Coordinator = #objref\
 Status = atom()\

Returns the status of the parent transaction associated with the target object. If the target object is a top-level transaction this operation is equivalent to *get\_status/1* operation.

Possible Status replies:

- \*

  'StatusCommitted'

- \*

  'StatusCommitting'

- \*

  'StatusMarkedRollback'

- \*

  'StatusRollingBack'

- \*

  'StatusRolledBack'

- \*

  'StatusActive'

- \*

  'StatusPrepared'

- \*

  'StatusUnknown'

- \*

  'StatusNoTransaction'

- \*

  'StatusPreparing'

**get\_status(Coordinator) -\> Status**\

Types:

Coordinator = #objref\
 Status = atom()\

Returns the status of the transaction associated with the target object.

**get\_top\_level\_status(Coordinator) -\> Status**\

Types:

Coordinator = #objref\
 Status = atom()\

Returns the status of the top-level transaction associated with the target object.

**hash\_top\_level\_tran(Coordinator) -\> Return**\

Types:

Coordinator = #objref\
 Return = integer()\

Returns a hash code for the top-level transaction associated with the target object. Equals the operation *hash\_transaction/1* if the target object is a top-level transaction.

**hash\_transaction(Coordinator) -\> Return**\

Types:

Coordinator = #objref\
 Return = integer()\

Returns a hash code for the transaction associated with the target object.

**is\_descendant\_transaction(Coordinator, OtherCoordinator) -\> Return**\

Types:

Coordinator = #objref\
 OtherCoordinator = #objref\
 Return = Boolean\

Returns true if the transaction associated with the target object is a descendant of the transaction associated with the parameter object.

**is\_same\_transaction(Coordinator, OtherCoordinator) -\> Return**\

Types:

Coordinator = #objref\
 OtherCoordinator = #objref\
 Return = Boolean\

Returns true if the transaction associated with the target object is related to the transaction associated with the parameter object.

**is\_top\_level\_transaction(Coordinator) -\> Return**\

Types:

Coordinator = #objref\
 Return = Boolean\

Returns true if the transaction associated with the target object is a top-level transaction.

**register\_resource(Coordinator, Resource) -\> RecoveryCoordinator**\

Types:

Coordinator = #objref\
 Resource = #objref\
 RecoveryCoordinator = #objref\

This operation registers the parameter *Resource* object as a participant in the transaction associated with the target object. The *RecoveryCoordinator* returned by this operation can be used by this Resource during recovery.

**Note:**

The Resources will be called in FIFO-order when preparing or committing. Hence, be sure to register the Resources in the correct order.

Raises exception:

- \*

  'Inactive' - if target transaction has already been prepared.

**register\_subtran\_aware(Coordinator, SubtransactionAwareResource) -\> Return**\

Types:

Coordinator = #objref\
 Return = ok\

This operation registers the parameter *SubtransactionAwareResource* object such that it will be notified when the transaction, associated wit the target object, has committed or rolled back.

**Note:**

The Resources will be called in FIFO-order. Hence, be sure to register the Resources in the correct order.

**rollback\_only(Coordinator) -\> Return**\

Types:

Coordinator = #objref\
 Return = ok\

The transaction associated with the target object is modified so the only possible outcome is to rollback the transaction.
