Oracle Application Server InterConnect Adapter for DB Installation and User's Guide 10g (9.0.4) Part Number B10415-01 |
|
This chapter provides answers to frequently asked questions about the Database adapter. This chapter discusses the following topics:
The following questions address installation of the Database adapter.
This information is used to find where the stored procedures generated through iStudio will be installed for application inbound messages. At runtime, the Database adapter uses this information to call a user-specified stored procedure. This user can be an existing user or a user created specifically for OracleAS InterConnect.
Edit the adapter.ini
file located in the ORACLE_HOME
/oai/9.0.4/adapters/[AppType][Partition]
directory.
Edit the db_bridge_schema<#>_port
parameter.
Using the Oracle Universal Installer, only one Database adapter can be installed in a single Oracle Home. However, copies of the Database adapter using the copyAdapter
script available in the ORACLE_HOME
/oai/9.0.4/bin
directory. Usage: copyAdapter dbapp1 dbapp2
The script will create a copy of the already installed Database adapter called dbapp1 with a name of dbapp2.
The following are design time questions for the Database adapter.
The PL/SQL code is save in the ORACLE_HOME
/oai/4.1/iStudio
directory. iStudio allows any extension to be specified which is used to prefix the name of every SQL file generated through iStudio. The following convention is used in naming the SQL files:
<PrefixSpecifiedInIStudio>_<ApplicationName>_<BusinessObject>TYPES.sql <PrefixSpecifiedInIStudio>_<ApplicationName>_<BusinessObject>.sql
Please see "Returned In Arguments".
The following steps describe how to export procedures for the Database adapter.
Two files are created for each application and business object if a base name is selected. The <base name>_<application name>_<business object name>.sql
file defines all stored procedures for all messages from the selected business object and application. The <base name>_<applicationname>_<business object name>TYPES.sql
file defines all types used by the stored procedures in the first file.
If you do not want to export all stored procedures for all applications as this can take a while, select one or more applications. Only the stored procedures for those applications will be generated. You can also select messages based on the role; for example, if you select publish, then only publish messages will be generated. Or, you can choose to export the stored procedures for specific messages by selecting those messages in the tree.
The database does not allow arrays of arrays. Therefore, the application view of database messages should not contain arrays of arrays. For example, the application view of a database message can contain an array of Customers which each contained one Address. However, it can not contain an array of Customers which each contained an array of Addresses.
The following questions address runtime concepts for the Database adapter.
A start executable that is not the OracleAS InterConnect start
script must be running. This is dependent on what is in the PATH environment variable. Therefore, run the start
script as follows:
Platform | Executable |
---|---|
UNIX |
|
Windows |
Use the Service Panel. |
Make sure you none of the PL/SQL reserved keywords are used in OracleAS InterConnect messages. For example, for a Phone object contains the attributes areacode
and number
, a problem would occur because number
is a reserved keyword in PL/SQL.
Before a Database adapter can publish events, some stored procedures need to be generated in iStudio.
iStudio will create two SQL scripts for a publish message; one with stored procedures and one with types. The types
script name will end with TYPES.sql
. Using any username, load the types
scripts and the stored procedure script into the database.
When an event occurs, there are several PL/SQL methods that must be called to publish the event message. All of the methods reside in the <event business object>
package which is created in the stored procedure SQL script. The first procedure that must be called is crMsg_<event name>_<event owner>_<event version>
. It has two out arguments which are both of type number
--the message id and the root data type id.
Next, populate the message with the correct data. For each non-primitive attribute that the message contains, there is a function called cr_<data type name>_<attribute name>
. This function has one argument for each primitive attribute it contains and it takes the message id and the parent data type id. It returns a number which is the data type id. When all data types have been created, a procedure must be called to publish the message. This procedure is named pub_<event name>_<eventowner>_<event version>
. This procedure has three arguments: the message id, the source application name, and the destination application name. The destination application name is ignored, so pass in whatever is applicable.
For example, an event in the Customer
business object is called create
. Application A
publishes this event. The application view of this event contains an attribute called C
of type cust
. The cust
type contains a name
attribute which is a String and a loc
attribute of type Location
. The Location
type contains a city
attribute which is a String and a state
attribute which is also a String. The following piece of code would publish a create
event.
DECLARE moid NUMBER; aoid NUMBER; custid NUMBER; locid NUMBER; BEGIN Customer.crMsg_create_TEST_V1(moid, aoid); custid := Customer.cr_cust_c('Homer', moid, aoid); locid := Customer.cr_Location_loc('Redwood Shores', 'CA', moid, custid); Customer.pub_create_TEST_V1(moid, 'a', ''); END
This is very similar to publishing events. All of the steps are the same until the final procedure call. The name is inv_<proc name>_<proc_owner>_<proc version>
and has three IN arguments: the message id, the source application name, and a timeout. The timeout is how many seconds to wait for a response. The event also has as many OUT arguments as the procedure defined in iStudio has.
Before a Database adapter can subscribe to events, some stored procedures need to be generated in iStudio.
iStudio will create two SQL scripts for a subscribe message: one with stored procedures and one with types. The types script name will end with TYPES.sql
. Under the same user name specified on the Database Configuration page during installation, load the types
scripts and the stored procedure script into the database. A pre-existing user can be specified, but if a user name that does not exist is entered, that user must be created manually.
The DB adapter will call the procedure sub_<event name>_<event owner>_<event version>
in the package <eventbusiness object>
when a message is received. Add PL/SQL code in this method to perform whatever tasks are necessary when this kind of message is received. This code can be added in iStudio when creating the message, or modify the stored procedure SQL script before loading it into the database.
The steps are very similar to subscribing to events. However, the procedure that the Database adapter will call is imp_<procname>_<proc owner>_<proc version>
. This procedure will have OUT arguments corresponding to the OUT arguments in the procedure defined in iStudio. In addition to writing PL/SQL code to perform the necessary tasks, the OUT arguments must be filled in with correct values. Write this code in iStudio when creating the message, or modify the stored procedure SQL script before loading it into the database. If the start
script is used to start the Database adapter, there is a way to determine if the Database adapter was started properly. This can be viewed in the oailog.txt
file in the logs directory of the Database adapter.
|
![]() Copyright © 2002, 2003 Oracle Corporation. All Rights Reserved. |
|