Vous êtes sur la page 1sur 13

Publication Service Tabs Page 1 of 13

Chapter 4 Adapter Service Options : Publication Service Tabs

Publication Service Tabs


When running as a publisher, the adapter extracts data from the changed rows from
database tables and publishes them on appropriate subject names.
You can configure parameters under the following tabs:
● Configuration Tab
● Tables Tab
● DB2/OS390 Tab
● DB2/AS400 Tab
● Publisher Options Tab
● Advanced Tab
Configuration Tab
The wire format for the publication and subscription services must be the same, otherwise an
error will occur. .

Table 15 Publication Service:Configuration Tab


Field Description

Name You can use the default name or replace it with a name of your choice.

Transport Select the transport type (JMS or TIBCO Rendezvous) to be used by the run-
Type time adapter. This selection determines which options appear in the rest of
the Configuration tab.
The transport can be configured to use a trusted store and identity resource
for use in SSL (Secure Sockets Layer) configurations. TIBCO Rendezvous
sessions and JMS topics have an SSL configuration field which uses a dialog
to perform SSL configuration.
To enable and configure SSL, in the Project panel, expand the Advanced
folder, then expand the Sessions folder. Select the TIBCO Rendezvous
session or JMS topic and click Use SSL?. The SSL configuration options are
explained in the online help associated with the session dialog. Click the
question mark to display the online help.

Quality of (Only available when TIBCO Rendezvous is selected as the transport type)
Service Select the level of service that determines how messages are sent. See
Quality of Service for a description of these options.
● Reliable
● Certified

Wire Format The wire format in which data will be sent. Note that the wire format for both
the publisher and subscriber must be the same, otherwise an error will occur.
See Wire Formats for a description of these formats.
● ActiveEnterprise Message (TIBCO Rendezvous transport type only)
● Rendezvous Message (TIBCO Rendezvous transport type only)

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 2 of 13

● XML Message

Connection (Only available when JMS is selected as the transport type) Connection
Factory Type Factory objects create JMS connections for sending and receiving messages.
Available choices are:
● Topic
Publish-subscribe messaging. A message published to a topic is broadcast to
one or more subscribers. All messages published to the topic are received by
all services that have subscribed to the topic.
● Queue
Point-to-point messaging. A message sent to a queue is consumed by one
and only one receiver. Each message has only one receiver though multiple
receivers may connect to the queue. The first receiver to access the queue
gets the message. The other receivers do not.

Delivery (Only available when JMS is selected as the transport type) The delivery
Mode mode for each message sending operation. See Delivery Mode for a
description of each mode.
● Persistent
● Non-Persistent

Note the following restrictions:


● A service name must use alphanumeric characters. An underscore (_) character can be
used. The entire instance name must be less than 80 characters. The space character
cannot be used in an instance name.
● A service name cannot use global variables.
Tables Tab
You must set publisher table options before configuring other publisher options.
Source table names can be qualified with a database user name. To access tables in other
schemas, the database user specified in the Design-time Connection Tab tab must have the
proper set of permissions granted. This is described in Referencing an External Schema.

If a primary key is not defined for a table, the update and delete triggers will
not be generated for the table. To define a primary key for the table, select
the User Key column in a table row. The update and delete triggers will then
be defined.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 3 of 13

Icons

● Add Table — Click to display a dialog box that list tables available to the database
user specified in the adapter Connection tab. Select the source table to publish from
when data is inserted into it.

● Add Child Table — Displays a dialog box from which a secondary table can be
added to the configuration.

● Add Table from Other Schema — Allows you to add a table from a different
schema than the current database user schema. For instructions on granting access
privileges to an external schema, see Referencing an External Schema. You can use this
icon to add different schema at the parent and child levels.

● Remove Table — Deletes the selected table from the list.

● Re-find Tables from Database — Causes TIBCO Designer to refresh stored


table schema information by retrieving new information from the database.

● Load Table Schema from Database — Allows you to load a database table
schema, convert it into a TIBCO ActiveEnterprise schema, and store it in the schema
folder of an instance.
Allow Key Columns Only
When this box is checked, child columns are joined only to a key column. When unchecked,
child columns can be joined to any column.
Select/Deselect All Columns to Publish
When this box is checked, all of the boxes in the Use column are checked, so all columns in
the tables are published. Unchecking this box unselects all of the columns. You can also
individually check and uncheck the Use boxes.

Table 16 Publication Service Tables tab

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 4 of 13

Field Description

Tables and The loaded tables and columns.


Columns indicates a table or child table.
indicates a normal column.
indicates a User Key column.

Type The primitive type.

AE Type The primitive type mapped to an TIBCO ActiveEnterprise type.

User Key Click to define the column as a user key.

Update Trigger? Check the box to fire a trigger when an UPDATE statement changes a
value in the column.

Use? Click to publish this column when data is changed.

Join To The name of a parent table column to join to for parent-child


relationships.

Referencing an External Schema


To reference an external schema in TIBCO Designer, the default schema must have the
proper access privileges. These are set in a command line. In the following syntax,
adb_schema refers to the default schema in create_user.sql.
For Oracle, log in as system and grant create any trigger and drop any trigger permissions
to the default schema. For example:
grant create any trigger to adb_schema
grant drop any trigger to adb_schema
In addition, Oracle and Sybase users must have permission to SELECT from a source table in
an external schema. If table relationships are used, SELECT permission is required for both
parent and child tables. SELECT, INSERT, UPDATE, and DELETE permissions are required for
accessing a destination table in an external schema.
For Sybase, execute the following before creating catalog tables for the external schema:
sp_role "grant", sa_role, adb_schema
For SQL Server 7.0 and 2000, log in as sa and then execute the following before creating
catalog tables for the external schema:
use master
EXEC sp_addsrvrolemember 'adb_schema', 'sysadmin'
For DB2 on AS400 you can avoid table access problems by changing the ActiveDatabase
user authority to *ALLOBJ.
Adding Child Tables
This section describes how to add a related child table definition for publishing data.
Data models typically contain tables that share column data through a relationship. You can
configure a publishing table to include related data from another table when it publishes.
Data from the related table is not copied into the publishing table, but is fetched by reference.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 5 of 13

When rows are inserted into the publishing table, a message that includes data from the
source table and related (child) table is published. On the subscriber side, a corresponding
table with the same columns as the child table associated with the publishing table must be
specified.
Adding child tables requires two separate procedures, one for the publisher adapter and
another for the subscriber. First, you add child tables for the source table, then you add child
tables for the destination table.
The database schema must be the same for all tables, but the table names can be different.
If the child table associated with the publishing table and the child table associated with the
destination table have different names, you must set a mapping between the child tables.
The following restrictions apply to parent and child tables:
● The child table in the source database and child table in the destination database must
have the same columns.
● When parent-child relationships are defined, a subscriber adapter must use the same
repository as the publisher adapter.
When you add a child table, TIBCO Designer creates a class object in the repository for the
child table, and an association object for the relationship.

To enable publishing child table related data, the publisher adapter


properties file must have the adb.publishChildData option set to on.

After adding child tables for a subscriber adapter, you create mappings between child tables
on the publisher side and child tables on the subscriber side. For instructions, see Child
Table Mappings Tab.
To add child tables for parent-child relationships, do the following in the Publication Service
Tables Tab:
1. Click the name of the parent table to select it.
2. Click the Add Child Table icon. The Add Table dialog displays.
3. Select the related child table from the list and click OK.
4. Repeat the above steps to add more child tables.
When all of the child tables are added, you then designate a foreign key column as a key in
each child table so that a relationship to the parent table can be defined.
5. Click the User Key checkbox for the foreign key column in the child table to select it. A
key icon displays next to the column name.
You must also specify the relationship between the primary column in the parent table and
the foreign key column in the child table.
6. Click in the Join To field for the child table column, and select the name of the parent
table primary key column from the drop-down list.
7. Click Apply.
In the following example, a publication service that publishes newly inserted rows into the
source table is created. Publisher Options Tab explains how to configure the publisher
adapter to publish data by value or by reference.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 6 of 13

In the following example, a subscription is created such that received data will be inserted
into the SUB_ORDER_DETAILS destination table. All three columns of the destination table are
configured to receive data.

The following example shows a child table mapped. The left column (Subscriber Child
Table Name) contains the subscriber child table and the right column (Publisher Child
Table Name) contains the publisher child table.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 7 of 13

DB2/OS390 Tab
This tab appears when the Vendor field in the Adapter Instance Configuration Tab is set to
DB2 OS390.

When the DB2 load utility loads rows to the source table, it does not activate
the table’s INSERT triggers. Loaded data is not published.

Table 17 Publication Service DB2/OS390 Tab


Field Description

Database Enter the name of the database that you want to put your publisher table in.
Name

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 8 of 13

Table Space Enter the name of the table space where the publisher table is located.
Name

Storage Group Optional. Enter the designator of the storage group that will hold the
publisher table indexes.

Buffer Pool Optional. Enter the name of the buffer pool to be used for indexes.

Index Suffix Enter a suffix of your choice, up to 13 characters, that the adapter will
append to each of the indexes (IDX1_, IDX2_, and IDX3_).

Trigger Suffix Enter a suffix of your choice, up to 5 characters, that adapter software will
append to each of the triggers (T1, T2, and T3).

DB2/AS400 Tab
This tab appears when the Vendor field in the Adapter Instance Configuration Tab is set to
DB2 AS400.
Trigger Option
● Synchronous (deprecated) — The trigger is written in RPG. When copying from the
source table to the publishing table, the prompt is not returned until all data is written.
● Asynchronous — When copying from the source table, data is inserted into a data queue
and then inserted into the publishing table asynchronously. The prompt is not blocked, so
you can continue working while data is inserted into the publishing table.
Specify values for the following options:
− Number of DataQueue Listeners: The number of prestarted listener jobs.
− Listener Job Queue: The name of the queue on the AS/400 machine where the
listener jobs are submitted.
If you select Asynchronous, you must go to the adapter’s Design-time Connection tab
and add ;transaction isolation level=none to the end of the JDBC URL field value. For
example:

● SQL — The trigger is written in SQL. When copying from the source table to the
publishing table, the prompt is not returned until all data is written.
Sybase Options

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 9 of 13

This tab appears when the Vendor field in the Adapter Instance Configuration Tab is set to
Sybase.
Check the checkbox for Overwrite Triggers? to delete and re-create existing triggers of the
publishing table.

Publisher Options Tab


When you add a new publishing table, a new entry is inserted into the repository for the
publisher adapter. The entry includes the name of a publishing table along with a sequence,
stored procedure, and trigger. A class object for the publication is created in the repository.

Table 18 Publication Service DB2/AS400 Tab


Field Description

Storage ● Publish by Value copies all specified columns in the source table to the
Mode publishing table.
● Publish by Reference copies only key column values to the publishing
table. If no key column is defined in the database, a substitute non-key
column must be defined to publish by reference.
For each publisher service, you must specify a Storage Mode: Publish by
Value or Publish by Reference. See Publish by Value and Publish by
Reference for more information.

Publishing Name of the database table used to store a copy of data to be published. The
Table table name can be qualified using the <schema>.<tableName> format. The
publishing table cannot contain any user-created columns where the column
name starts with ADB_. These characters are reserved for use by the adapter.
A common practice is to use the publishing table name prefixed by P_. For
example, if your source table is MY_ORDER, its publishing table should be
named P_MY_ORDER.
A publishing table name must be less than 64 characters.

Update Mode Select the method by which tables are updated.


Update updates a row in the destination table only if the row exists.
Upsert updates a row in the destination table if the row exists. If no such row
exists, it performs an insert.

Enable Loop Select to enable loop detection and prevent an infinite loop from occurring
Detection when the publishing and destination table are the same table. Loop detection
is disabled for DB2 on z/OS because of DB2 on z/OS feature limitations.

Do Not Select to prevent the generation of triggers. Although this option is not
Generate recommended, it allows you to manually manage the insertion of data into the
Triggers publishing table.

Use Alerter Select to use the alerter. This option appears only if you are using an Oracle
database. See Chapter 6, Using the Alerter for details.

Enable Select to use group messaging.


Group
Messaging

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 10 of 13

Group Size Appears only when Enable Group Messaging is selected. Specify the
number of rows to publish in a single message.

Publish by Value
With Publish by Value, all specified columns in the source table are copied to the
publishing table. Publishing by value is fast, but does not support some data types, for
example Oracle LONG and LONG RAW.
Note the following restrictions on publishing tables when you publish by value:
● Publishing tables cannot contain columns with LONG data types. If you have a source
table that contains a column with a LONG data type, that column cannot be specified for
inclusion in the publishing table. This is because the trigger generated by the palette
cannot refer to the LONG column via the :new construct.
This is an Oracle restriction documented in the Oracle SQL Reference manual. The
problem is not detected by Oracle during trigger creation. However, when the trigger fires
and it attempts to copy the LONG column value to the publishing table, the database
connection will hang for some time and then eventually terminate.
● If you define parent-child relationships between tables, the publishing table that is created
for a parent table should not contain a column with a LONG data type. However, a child
table can contain a column with a LONG data type. This is because data on child table
rows is not copied using the :new construct.
● LONG RAW data is not allowed in the publishing table.
These restrictions do not apply to publishing tables when you publish by reference and
LONG or LONG RAW are non-key types.
In the following example, the publishing table P_CUSTOMER is created for the source table,
CUSTOMER. When CUSTOMER is updated, the new data will be copied to P_CUSTOMER. The
adapter will poll P_CUSTOMER and publish the new data.

In this example, loop detection is enabled. If a subscription exists that uses


the same subject and CUSTOMER as the destination table, any changes to
CUSTOMER will not be published repeatedly.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 11 of 13

Publish by Reference
With Publish by Reference, only key column values are copied to the publishing table.
The publish by reference feature allows you to publish data directly from the source table
without first copying the data from the source table to a publishing table. A trigger, stored
procedure, and publishing table are created, but the publishing table contains the necessary
adapter fields and only the key fields of the source table. For more information, see Start or
Stop the Adapter.
The advantage of publishing by reference is that the data to be published is stored just once.
Also, data types such as Oracle LONG and LONG RAW are supported for publishing by
reference.
A key column or substitute key column is required when publishing by reference, since the
publishing table contains only key values. If no column is specified, the publication is not
added.

To use a view or other database object as the source table, you can
configure the adapter to publish by reference object, where key columns are
stored in the publishing table and data to publish is selected from the
reference object. For details, see Publishing by Reference Object.

In the following example, the publisher adapter is configured to publish from the P_CUSTOMER
table with a key field CUST_ID. The publishing table is created with the necessary fields and
the CUST_ID field. When a row in the P_CUSTOMER table is modified, the trigger fires,
populating fields and copying the CUST_ID value to the publishing table. When the adapter
polls the publishing table, it detects the new row and selects from the P_CUSTOMER table
using the CUST_ID value found in the publishing table. Then the message is published.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 12 of 13

Advanced Tab
Specify values for the following fields:

Table 19 Publication Service Advanced Tab


Field Description

Destination (Only available when JMS is selected as the transport type in the Adapter
Instance Configuration Tab)
The publisher destination. A service uses a default destination generated
using the Domain and Deployment global variables, the adapter acronym, the
adapter instance name and the service name. If you use this default
destination, make sure the values for Domain and Deployment are not empty.
Alternatively, you can manually enter a destination in this field. The destination
does not have to be predefined in the TIBCO Enterprise Message Service
server. The destination can be static or dynamic.
See the TIBCO Enterprise Message Service documentation for information
about destinations.

Message (Only available when TIBCO Rendezvous is selected as the transport type in
Subject the Adapter Instance Configuration Tab)
Publisher subject. By default, a service uses a message subject that is
generated using the Domain and Deployment global variables, the adapter
acronym, the adapter instance name and the service name. If you use this
default subject, make sure the values for Domain and Deployment are not
empty. You can type a TIBCO Rendezvous subject name different from the
default in this field.
See TIBCO Rendezvous Concepts for information about specifying subject
names.

Endpoint Displays the endpoint reference. Click the Browse icon to change the
Reference endpoint reference, the Go To icon to reconfigure the existing reference, or
the Delete icon to delete the reference. Endpoint reference objects are
explained in TIBCO Designer Palette Reference.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011
Publication Service Tabs Page 13 of 13

Class Click the Go To icon to reconfigure the existing reference. "Clear reference"
Reference can be used to remove the reference under Endpoint Reference. Class
reference objects are explained in TIBCO Designer Palette Reference.

Copyright © TIBCO Software Inc. All Rights Reserved.

http://localhost:9889/doc/adbadapter/html/tib_adadb_config_deploy/ADB_config_deploy.5.... 4/5/2011

Vous aimerez peut-être aussi