JMS/XLA MapMessage Contents

A jakarta.jms.MapMessage instance for Jakarta JMS or javax.jms.MapMessage instance for JavaX JMS contains a set of typed name/value pairs corresponding 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.

XLA Update Types

Each MapMessage instance returned by the JMS/XLA API contains at least one name/value pair, __TYPE (with 2 underscores), that identifies the type of update described in the message. The types are specified as integer values.

Table 6-1 lists the supported types.

Note:

As a convenience, you can use the constants defined in com.timesten.dataserver.jakartajmsxla.XLAConstants for Jakata JMS or com.timesten.dataserver.jmsxla.XlaConstants for JavaX JMS to compare against the integer types.

Table 6-1 XLA Update Types

Type Description

ADD_COLUMNS

Indicates that columns have been added.

COMMIT_FIELD

This is the name of the field in a message that contains a commit.

COMMIT_ONLY

Indicates that a commit has occurred.

CONTEXT_FIELD

This is the name of the field in a message that contains the context value passed to the ttApplicationContext procedure as a byte array.

CREATE_INDEX

Indicates that an index has been created.

CREATE_SEQ

Indicates that a sequence has been created.

CREATE_SYNONYM

Indicates that a synonym has been created.

CREATE_TABLE

Indicates that a table has been created.

CREATE_VIEW

Indicates that a view has been created.

DELETE

Indicates that a row has been deleted.

DROP_COLUMNS

Indicates that columns have been dropped.

DROP_INDEX

Indicates that an index has been dropped.

DROP_SEQ

Indicates that a sequence has been dropped.

DROP_SYNONYM

Indicates that a synonym has been dropped.

DROP_TABLE

Indicates that a table has been dropped.

DROP_VIEW

Indicates that a view has been dropped.

FIRST_FIELD

This is the name of the field that contains the flag that indicates the first record in a transaction.

INSERT

Indicates that a row has been inserted.

MTYP_FIELD

This is the name of the field in a message that contains type information.

MVER_FIELD

This is the name of the field in a message that contains the transaction log file number of the XLA record.

NULLS_FIELD

This is the name of the field in a message that contains the list of fields that have null values.

REPL_FIELD

This is the name of the field in a message that contains the flag that indicates that the update was applied by replication.

TBLNAME_FIELD

This is the name of the field in a message that contains the table name.

TBLOWNER_FIELD

This is the name of the field in a message that specifies the table owner.

TRUNCATE

Indicates that a table has been truncated.

TYPE_FIELD

This is the name of the field in a message that specifies the message type.

UPDATE

Indicates that a row has been updated.

UPDATE_DESCRIPTOR_FIELD

This is the name of the field that returns a ttXlaUpdateDesc_t structure as a byte array.

UPDATED_COLUMNS_FIELD

This is the name of the field in a message that contains the list of updated columns.

XLA Flags

For all update types, the MapMessage instance contains name/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/value pairs that contain these XLA flags are described in Table 6-2. Each name is preceded by two underscores.

Table 6-2 JMS/XLA Flags

Name Description Corresponding ttXlaUpdateDesc_t Flag

__AGING_DELETE

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 XlaConstants constant AGING_DELETE_FIELD represents this flag.

TT_AGING

__CASCADING_DELETE

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 XlaConstants constant CASCADING_DELETE_FIELD represents this flag.

TT_CASCDEL

__COMMIT

Indicates that this is the last record in a transaction and that a commit was performed after this operation. This is in the MapMessage if TT_UPDCOMMIT is on. The XlaConstants constant COMMIT_FIELD represents this flag.

TT_UPDCOMMIT

__FIRST

Indicates that this is the first record in a new transaction. This is in the MapMessage if TT_UPDFIRST is on. The XlaConstants constant FIRST_FIELD represents this flag.

TT_UPDFIRST

__REPL

Indicates that this change was applied to the database through replication. This is in the MapMessage if TT_UPDREPL is on. The XlaConstants constant REPL_FIELD represents this flag.

TT_UPDREPL

__UPDCOLS

This is only used for UPDATETUP records, indicating that the XLA update descriptor contains a list of columns that were actually modified by the operation. It is specified as a string that contains a semicolon-delimited list of column names and is in the MapMessage only if TT_UPDCOLS is on. The XlaConstants constant UPDATE_COLUMNS_FIELD represents this flag.

TT_UPDCOLS

Note:

The XlaConstants 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.

Equivalent to using TT_UPDCOMMIT in XLA, you can use the following test in JMS/XLA to see whether this is the last record in a transaction and that a commit was performed after the operation.

if (MapMessage.getBoolean(XlaConstants.COMMIT_FIELD) ) { // Field is set
   ...
}