TIBCO ActiveSpaces®

Typedefs | Functions
conn.h File Reference

Applications use a connection object to create sessions. More...

## Typedefs
typedef struct __tibdgConnectionId * | tibdgConnection
| The connection object provides access to a data grid. More...

## Functions
TIBDG_API void | tibdgConnection_Close (tibEx e, tibdgConnection conn)
| Close a connection object. More...
TIBDG_API tibdgSession | tibdgConnection_CreateSession (tibEx e, tibdgConnection conn, tibProperties props)
| Create a session object to perform operations. More...
TIBDG_API tibdgGridMetadata | tibdgConnection_GetGridMetadata (tibEx e, tibdgConnection conn, tibProperties props)
| Retrieve the current data grid metadata in an object. More...
TIBDG_API void | tibdgConnection_Interrupt (tibEx e, tibdgConnection conn)
| Interrupt a connection object. More...
TIBDG_API tibdgConnection | tibdgGrid_Connect (tibEx e, const char *URL, const char *gridName, tibProperties props)
| Create a connection object. More...

## Detailed Description

Applications use a connection object to create sessions.

## Typedef Documentation

## ◆ tibdgConnection

typedef struct __tibdgConnectionId* tibdgConnection

The connection object provides access to a data grid.

The connection object creates or opens all resources associated with a given data grid.

A program that creates a connection must explicitly call tibdgConnection_Close to reclaim its resources.

Connection object type.

## Function Documentation

## ◆ tibdgConnection_Close()

TIBDG_API void tibdgConnection_Close | ( | tibEx | e,
|  | tibdgConnection | conn
| ) |  |

Close a connection object.

Releases all resources associated with this connection object.

Note that all resources created or opened by this object are invalidated by this call. These resources should be destroyed or closed before closing this connection.

Parameters

  e | The exception object captures information about failures.
  conn | The connection to be destroyed.

Returns
  void

## ◆ tibdgConnection_CreateSession()

TIBDG_API tibdgSession tibdgConnection_CreateSession | ( | tibEx | e,
|  | tibdgConnection | conn,
|  | tibProperties | props
| ) |  |

Create a session object to perform operations.

A session object provides the context for a thread of operations involving data grid resources.

The session object is NOT thread-safe. Do not invoke multiple operations on a single session using more than one thread. Behavior is not defined if this happens.

Parameters

  e | The exception object captures information about failures.
  conn | The connection on which to create this session.
  props | Optional. `NULL` to omit. TIBDG_SESSION_PROPERTY_BOOLEAN_TRANSACTED TIBDG_SESSION_PROPERTY_DOUBLE_TRANSACTION_TIMEOUT TIBDG_SESSION_PROPERTY_STRING_CHECKPOINT_NAME

Returns
  On success, this call returns a new session object.
  On failure, this call returns `NULL`.

## ◆ tibdgConnection_GetGridMetadata()

TIBDG_API tibdgGridMetadata tibdgConnection_GetGridMetadata | ( | tibEx | e,
|  | tibdgConnection | conn,
|  | tibProperties | props
| ) |  |

Retrieve the current data grid metadata in an object.

A grid metadata object contains information about the data grid including name, version, and additional metadata about tables.

The information in a grid metadata object will be current when the request returns and will not be updated after that point.

A grid metadata object must be closed to release internal state and no further access should be made to the grid metadata object or any nested objects after it has been closed.

Parameters

  e | The exception object captures information about failures.
  conn | The connection object used to retrieve the data grid metadata.
  props | Optional. `NULL` to omit.

Returns
  On success, this call returns a new data grid metadata object.
  On failure, this call returns `NULL`.

## ◆ tibdgConnection_Interrupt()

TIBDG_API void tibdgConnection_Interrupt | ( | tibEx | e,
|  | tibdgConnection | conn
| ) |  |

Interrupt a connection object.

Interrupts all outstanding requests on the connection forcing them to return an interrupted error (TIB_INTR).

Use this call to interrupt long-running requests such as executions of queries with long or unlimited fetch timeouts. This can be helpful prior to closing the connection.

Parameters

  e | The exception object captures information about failures.
  conn | The connection to be interrupted.

Returns
  void

## ◆ tibdgGrid_Connect()

TIBDG_API tibdgConnection tibdgGrid_Connect | ( | tibEx | e,
|  | const char * | URL,
|  | const char * | gridName,
|  | tibProperties | props
| ) |  |

Create a connection object.

Applications use a connection object to create sessions.

Parameters

  e | The exception object captures information about failures.
  URL | The URL to use for getting FTL realm server information.
  gridName | The dataGridName identifies the data grid to which this call connects. Passing `NULL` selects the default data grid (which is named "_default").
  props | Optional. `NULL` to omit. TIBDG_CONNECTION_PROPERTY_DOUBLE_CONNECT_WAIT_TIME TIBDG_CONNECTION_PROPERTY_DOUBLE_TIMEOUT TIBDG_CONNECTION_PROPERTY_LONG_BINDSTRATEGY TIBDG_CONNECTION_PROPERTY_LONG_CONNECT_NUMRESPONSES TIBDG_CONNECTION_PROPERTY_LONG_TRANSPORT_TYPE TIBDG_CONNECTION_PROPERTY_LONG_REALM_CONNECT_RETRIES TIBDG_CONNECTION_PROPERTY_STRING_CLIENT_LABEL TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYNAMES TIBDG_CONNECTION_PROPERTY_STRING_CONNECT_PROXYPATTERN TIBDG_CONNECTION_PROPERTY_STRING_SECONDARY_REALM TIBDG_CONNECTION_PROPERTY_STRING_TRUST_FILE TIBDG_CONNECTION_PROPERTY_STRING_TRUST_TYPE TIBDG_CONNECTION_PROPERTY_STRING_USERNAME TIBDG_CONNECTION_PROPERTY_STRING_USERPASSWORD

Returns
  On success, this call returns a new connection object.
  On failure, this call returns `NULL`.