Programming with ActiveSpaces

These concepts and definitions pave the way to a more detailed understanding of applications programming with ActiveSpaces software.

Data Grid
A distributed database, including all the component processes that implement it.
Connection
An application program connects to a data grid. A Connection object is analogous to a traditional database connection.
Session
An application program interacts with a data grid through one or more Session objects. Each session insulates the data grid interactions within one program thread from the interactions in other threads.

A session can be transacted or non-transacted. GET, PUT, and DELETE operations in a transacted session occur within a transaction, and do not take effect until the program explicitly commits the transaction.

A session can be used to define the tables and indexes of the data grid by using SQL Data Definition Language (DDL) statements such as CREATE TABLE, DROP TABLE, CREATE INDEX, and DROP INDEX.

Table
An ActiveSpaces data grid organizes and presents data as rows in tables, like a traditional relational database.

Administrators define tables within the data grid.

Programs can GET a row from a table, PUT a row into a table, and DELETE a row from a table.

Programs can query a table for the rows that match a filter.

Primary Key

Each table distinguishes a primary key, or more briefly, the key.

Values of the key are unique: no two rows in a table have the same key value.

Secondary Index

A table can have zero or more secondary indexes, which facilitate queries. The tibdg tool can be used to create a secondary index on a table by using the index create command.

Iterator

An iterator is associated with a single table. An application can use an iterator to perform queries on a table. An iterator always returns entire rows from a table for its results.

Statement
A Statement is used to execute SQL statements. A Statement is not tied to a particular table. The table to act on is obtained from the SQL string used to create the Statement object. Statements can be used to execute SQL Data Manipulation Language (DML) statements. SQL DML statements include SELECT, INSERT, and so on.
ResultSet
A ResultSet contains the results of a SQL SELECT statement executed by using a Statement object. A ResultSet is used to iterate over the rows that satisfy the conditions of the SELECT statement. The columns of the rows in ResultSet are determined by the select list specified in the SQL SELECT statement.
Metadata

Metadata contains descriptive information about the data grid. There are two types of metadata: GridMetadata and ResultSetMetadata.

GridMetadata is retrieved from a Connection object. GridMetadata can be used to programmatically retrieve ActiveSpaces version information, the data grid name, and information about the tables that have been defined in the data grid. The table information includes the names of the tables that have been defined and also the information about the columns and indexes defined for each table.

ResultSetMetadata is retrieved from a ResultSet object. ResultSetMetadata can be used to find information about the columns in each row of a ResultSet. This column information includes the number of columns in a row, the labels and data types of the columns, whether or not a column can contain or return NULL values, and so on.