Oracle® TimesTen In-Memory Database Java Developer's Guide 11g Release 2 (11.2.2) E21638-05 |
|
|
PDF · Mobi · ePub |
This chapter provides reference information for the JMS/XLA API. It includes the following topics:
Note:
"Access control impact on XLA" introduces the effects of TimesTen access control features on XLA functionality.A javax.jms.MapMessage
contains a set of typed name and value pairs that correspond to the fields in an XLA update header, which is published as the C structure ttXlaUpdateDesc_t
. The fields contained in a MapMessage
instance depend on what type of update it is.
Each MapMessage
returned by the JMS/XLA API contains at least one name and value pair, __TYPE
(with 2 underscores), that identifies the type of update described in the message as an integer value. The types are specified as integer values. As a convenience, you can use the constants defined in com.timesten.dataserver.jmsxla.XlaConstants
to compare against the integer types. Table 6-1 shows the supported types.
For all update types, the MapMessage
contains name and value pairs that indicate the following.
Whether this is the first record of a transaction
Whether this is the last record of a transaction
Whether the update was performed by replication
Which table was updated
The owner of the updated table
The name and value pairs that contain these XLA flags are described in Table 6-2. Each name is preceded by two underscores.
Name | Description | Corresponding ttXlaUpdateDesc_t flag |
---|---|---|
|
Indicates that a delete was due to aging. The flag is present only if the XLA update record is due to an aging delete. The |
|
|
Indicates that a delete was due to a cascading delete. The flag is present only if the XLA update record is due to a cascading delete. The |
|
|
Indicates that this is the last record in a transaction and that a commit was performed after this operation. This is in the |
|
|
Indicates that this is the first record in a new transaction. This is in the |
|
|
Indicates that this change was applied to the database through replication. This is in the |
|
|
This is only used for |
|
Note:
TheXlaConstants
interface is in the com.timesten.dataserver.jmsxla
package.Applications can use the MapMessage
method itemExists()
to determine whether a flag is present, and getBoolean()
to determine whether a flag is set. As input, specify the XlaConstants
constant that corresponds to the flag, such as XlaConstants.AGING_DELETE_FIELD
.
Many DML operations generate XLA updates that can be monitored by XLA event handlers. This section describes the contents of the MapMessage
objects that are generated for these operations.
For INSERT
, UPDATE
and DELETE
operations, MapMessage
contains two name and value pairs, __TBLOWNER
and __TBLNAME
. These fields describe the name and owner of the table that is being updated. For example, for a table SCOTT.EMPLOYEES
, any related MapMessage
contains a field __TBLOWNER
with the string value "SCOTT" and a field __TBLNAME
with the string value "EMPLOYEES".
For INSERT
and DELETE
operations, a complete image of the inserted or deleted row is included in the message and all column values are available.
For UPDATE
operations, the complete "before" and "after" images of the row are available, along with a list of column numbers indicating which columns were modified. Access the column values using the names of the columns. The column names in the "before" image all begin with a single underscore. For example, columnname
contains the new value and _columnname
contains the old value.
If the value of a column is NULL
, it is omitted from the column list. The __NULLS
name and value pair contains a semicolon-delimited list of the columns that contain NULL
values.
Many data definition language (DDL) operations generate XLA updates that can be monitored by XLA event handlers. This section describes the contents of the MapMessage
objects that are generated for these operations.
Messages with __TYPE=1 (XlaConstants.CREATE_TABLE)
indicate that a table has been created. Table 6-3 shows the name and value pairs that are in a MapMessage
generated for a CREATE_TABLE
operation.
Table 6-3 CREATE_TABLE data provided in update messages
Name | Value |
---|---|
|
String value of the owner of the created table |
|
String value of the name of the created table |
|
String value containing the names of the columns in the primary key for this table If the table has no primary key, the Format: <col1name>[;<col2name> [;<col3name>[;...]]] |
|
String value containing the names of the columns in the table Format: <col1name>[;<col2name> [;<col3name>[;...]]] Note: For each column in the table, additional name and value pairs that describe the column are in the |
|
Integer value representing the data type of this column (from |
|
Integer value containing the precision of this column (for |
|
Integer value containing the scale of this column (for |
|
Integer value indicating the maximum size of this column (for |
|
Boolean value indicating whether this column can have a |
|
Boolean value indicating whether this column is stored in the inline or out-of-line part of the tuple |
|
Boolean value indicating whether this column is part of the primary key of the table |
Messages with __TYPE=2 (XlaConstants.DROP_TABLE)
indicate that a table has been dropped. Table 6-4 shows the name and value pairs that are in a MapMessage
generated for a DROP_TABLE
operation.
Messages with __TYPE=3 (XlaConstants.CREATE_INDEX)
indicate that an index has been created. Table 6-5 shows the name and value pairs that are in a MapMessage
generated for a CREATE_INDEX
operation.
Table 6-5 CREATE_INDEX data provided in update messages
Name | Value |
---|---|
|
String value of the owner of the table on which the index was created |
|
String value of the name of the table on which the index was created |
|
String value of the name of the created index |
|
String value representing the index type: "P" (primary key), "F" (foreign key), or "R" (regular) |
|
String value representing the index method: "H" (hash), "T" (range), or "B" (bit map) |
|
Boolean value indicating whether the index is unique |
|
Integer value representing the number of pages in a hash index (not specified for range indexes) |
|
String value describing the columns in the index Format: <col1name>[;<col2name> [;<col3name>[;...]]] |
Messages with __TYPE=4 (XlaConstants.DROP_INDEX)
indicate that an index has been dropped. Table 6-6 shows the name and value pairs that are in a MapMessage
generated for a DROP_INDEX
operation.
Messages with __TYPE=5 (XlaConstants.ADD_COLUMNS)
indicate that a table has been altered by adding new columns. Table 6-7 shows the name and value pairs that are in a MapMessage
generated for a ADD_COLUMNS
operation.
Table 6-7 ADD_COLUMNS data provided in update messages
Name | Value |
---|---|
|
String value of the owner of the altered table |
|
String value of the name of the altered table |
|
String value containing the names of the columns in the primary key for this table If the table has no primary key, the Format: <col1name>[;<col2name> [;<col3name>[;...]]] |
|
String value containing the names of the columns added to the table Format: <col1name>[;<col2name> [;<col3name>[;...]]] Note: For each added column, additional name and value pairs that describe the column are in the |
|
Integer value representing the data type of this column (from |
|
Integer value containing the precision of this column (for |
|
Integer value containing the scale of this column (for |
|
Integer value indicating the maximum size of this column (for |
|
Boolean value indicating whether this column can have a |
|
Boolean value indicating whether this column is stored in the inline or out-of-line part of the tuple |
|
Boolean value indicating whether this column is part of the primary key of the table |
Messages with __TYPE=6 (XlaConstants.DROP_COLUMNS)
indicate that a table has been altered by dropping existing columns. Table 6-8 shows the name and value pairs that are in a MapMessage
generated for a DROP_COLUMNS
operation.
Table 6-8 DROP_COLUMNS data provided in update message
Name | Value |
---|---|
|
String value of the owner of the altered table |
|
String value of the name of the altered table |
|
String value containing the names of the columns dropped from the table Format: <col1name>[;<col2name> [;<col3name>[;...]]] Note: For each dropped column, additional name and value pairs that describe the column are in the |
|
Integer value representing the data type of this column (from |
|
Integer value containing the precision of this column (for |
|
Integer value containing the scale of this column (for |
|
Integer value indicating the maximum size of this column (for |
|
Boolean value indicating whether this column can have a |
|
Boolean value indicating whether this column is stored in the inline or out-of-line part of the tuple |
|
Boolean value indicating whether this column is part of the primary key of the table |
Messages with __TYPE=14 (XlaConstants.CREATE_VIEW)
indicate that a materialized view has been created. Table 6-9 shows the name and value pairs that are in a MapMessage
generated for a CREATE_VIEW
operation.
Messages with __TYPE=15 (XlaConstants.DROP_VIEW)
indicate that a materialized view has been dropped. Table 6-10 shows the name and value pairs that are in a MapMessage
generated for a DROP_VIEW
operation.
Messages with __TYPE=16 (XlaConstants.CREATE_SEQ)
indicate that a sequence has been created. Table 6-11 shows the name and value pairs that are in a MapMessage
generated for a CREATE_SEQ
operation.
Table 6-11 CREATE_SEQ data provided in update messages
Name | Value |
---|---|
|
String value of the owner of the created sequence |
|
String value of the name of the created sequence |
|
Boolean value indicating whether the |
|
A |
|
A |
|
A |
Messages with __TYPE=17 (XlaConstants.DROP_SEQ)
indicate that a sequence has been dropped. Table 6-12 shows the name and value pairs that are in a MapMessage
generated for a DROP_SEQ
operation.
Messages with __TYPE=19 (XlaConstants.CREATE_SYNONYM
) indicate that a synonym has been created. Table 6-13 shows the name and value pairs that are in a MapMessage
generated for a CREATE_SYNONYM
operation.
Table 6-13 CREATE_SYNONYM data provided in update messages
Name | Value |
---|---|
|
String value of the owner of the created synonym |
|
String value of the name of the created synonym |
|
String value of the schema of the object for which you are creating a synonym |
|
String value of the name of the object for which you are creating a synonym |
|
Boolean value indicating whether the synonym is public |
|
Boolean value indicating whether the synonym was created using |
Messages with __TYPE=20 (XlaConstants.DROP_SYNONYM
) indicate that a synonym has been dropped. Table 6-14 shows the name and value pairs that are in a MapMessage
generated for a DROP_SYNONYM
operation.
Messages with __TYPE=18 (XlaConstants.TRUNCATE
) indicate that a table has been truncated. All rows in the table have been deleted. Table 6-15 shows the name and value pairs that are in a MapMessage
generated for a TRUNCATE
operation.
This section covers data type considerations for JMS/XLA.
Table 6-16 lists access methods for the data types supported by TimesTen. For more information about data types, see "Data Types" in Oracle TimesTen In-Memory Database SQL Reference.
TimesTen column type | Read with MapMessage method... |
---|---|
CHAR(n)
|
|
VARCHAR(n)
|
|
NCHAR(n)
|
|
NVARCHAR(n)
|
|
NVARCHAR2(n)
|
|
DOUBLE |
Can be converted to |
FLOAT |
Can be converted to |
DECIMAL(p,s)
|
Can be converted to |
NUMERIC(p,s)
|
Can be converted to |
INTEGER |
|
SMALLINT |
|
TINYINT |
|
BINARY(n)
|
|
VARBINARY(n)
|
|
DATE |
The Can be converted to |
TIME |
Can be converted to |
TIMESTAMP |
The Can be converted to |
TT_CHAR |
|
TT_VARCHAR |
|
TT_NCHAR |
|
TT_NVARCHAR |
|
ORA_CHAR |
|
ORA_VARCHAR2 |
|
ORA_NCHAR |
|
ORA_NVARCHAR2 |
|
VARCHAR2 |
|
TT_TINYINT |
|
TT_SMALLINT |
|
TT_INTEGER |
|
TT_BIGINT |
|
BINARY_FLOAT |
|
BINARY_DOUBLE |
|
REAL |
|
NUMBER |
|
ORA_NUMBER |
|
TT_DECIMAL |
|
TT_TIME |
|
TT_DATE |
The |
TT_TIMESTAMP |
The |
ORA_DATE |
The |
ORA_TIMESTAMP |
The |
TT_BINARY |
|
TT_VARBINARY |
|
ROWID |
|
|
Note: Information about the LOB value itself is unavailable. LOB fields contain zero-length data or null data (if the value is actually |
|
Note: Information about the LOB value itself is unavailable. LOB fields contain zero-length data or null data (if the value is actually |
The following JMS classes are available for JMS/XLA applications. Note that the JMS/XLA API supports only publish/subscribe messaging.
Message
(parent class only)
TopicConnectionFactory
Topic
TopicSubscriber
Connection
Session
ConnectionMetaData
MapMessage
TopicConnection
TopicSession
ConnectionFactory
Destination
MessageConsumer
ExceptionListener
See the following Java EE locations (the first for Java 6, the second for Java 5.0) for documentation of these classes:
http://docs.oracle.com/javaee/6/api/ http://docs.oracle.com/javaee/5/api/
The TimesTen com.timesten.dataserver.jmsxla
package includes the TargetDataStore
interface and the TargetDataStoreImpl
class.
See Oracle TimesTen In-Memory Database JMS/XLA Java API Reference for information.
This interface is used to apply XLA update records from a source database to a target database. The source and target database schema must be identical for the affected tables.
This interface defines the methods shown in Table 6-17.
Table 6-17 TargetDataStore methods
Method | Description |
---|---|
|
Applies XLA update descriptor to the target database. |
|
Closes the connections to the database and releases the resources. |
|
Performs a manual commit. |
|
Returns the value of the autocommit flag. |
|
Returns the database connection string. |
|
Returns the value of the flag for checking update conflicts. |
|
Checks whether the object is closed. |
|
Checks whether the database is valid. |
|
Rolls back the last transaction. |
|
Sets the flag for autocommit during apply. |
|
Sets the flag for checking update conflicts during apply. |
Table 6-18 shows the JMS message header fields provided by JMS/XLA.