BEA Logo BEA Tuxedo Release 7.1

  Corporate Info  |  News  |  Solutions  |  Products  |  Partners  |  Services  |  Events  |  Download  |  How To Buy

 

   Tuxedo Doc Home   |   Getting Started   |   Topic List   |   Previous   |   Next   |   Contents

   Tutorials for Developing a BEA Tuxedo Application

Step 5: Preparing for an XA-Compliant Resource Manager

To run bankapp with an alternative XA-compliant resource manager, you must modify various files. This section describes the following:

How to Change the bankvar File

  1. Review the following environment variables that are assigned the values shown here, by default, to create the BEA Tuxedo system database.

        BLKSIZE=512
    DBNAME=bankdb
    DBPRIVATE=no
    DIPCKEY=80953
    FSCONFIG=${APPDIR}/bankdl1

    Note: These environment variables pertain to the BEA Tuxedo system only; you may need to set different environment variables or other mechanisms depending on your specific database management system requirements.

  2. Change the value of these variables as needed to create the database for your resource manager.

How to Change the bankapp Services

Because all database access in bankapp is performed with embedded SQL statements, if your new resource manager supports SQL, you should have no problem. The utility appinit.c includes calls to tpopen() and tpclose().

How to Change the bankapp.mk File

  1. Edit the RM parameter in bankapp.mk to name the new resource manager.

  2. Ensure that the following entry is in the RM file.

    $TUXDIR/udataobj/RM

  3. If necessary, change the name of the SQL compiler and its options. The name of the source file may or may not include .ec. You may have to specify a non-default for compiling the resulting .c file.

How to Change crbank and crbankdb

  1. crbank may be ignored by your alternate resource manager. Its only functions are to reset variables and to run crbankdb three times.

  2. crbankdb, on the other hand, requires close attention. The following code listing is the beginning of the crbankdb script. It is followed by an explanation of parts of the code that do not work with a resource manager that is not supplied with the BEA Tuxedo system.

    Excerpt from the crbankdb Script


        #Copyright (c) BEA Systems, Inc.
    #All rights reserved
    #
    # Create device list
    #
    dbadmin<<!
    echo
    crdl
    # Replace the following line with your device zero entry
    ${FSCONFIG} 0 2560
    !
    #
    # Create database files, fields, and secondary indices
    #
    sql<<!
    echo
    create database ${DBNAME} with (DEVNAME='${FSCONFIG}',
    IPCKEY=${DIPCKEY}, LOGBLOCKING=0, MAXDEV=1,
    NBLKTBL=200, NBLOCKS=2048, NBUF=70, NFIELDS=80,
    NFILES=20, NFLDNAMES=60, NFREEPART=40, NLCKTBL=200,
    NLINKS=80, NPREDS=10, NPROCTBL=20, NSKEYS=20,
    NSWAP=50, NTABLES=20, NTRANTBL=20, PERM='0666',
    STATISTICS='n'
    )

        create table BRANCH (
    BRANCH_ID integer not null,
    BALANCE real,
    LAST_ACCT integer,
    LAST_TELLER integer,
    PHONE char(14),
    ADDRESS char(60),
    primary key(BRANCH_ID)
    ) with (
    FILETYPE='hash', ICF='PI', FIELDED='FML',
    BLOCKLEN=${BLKSIZE}, DBLKS=8, OVBLKS=2
    )
    !


The first 40 lines give you an idea of what needs to be changed and what may be kept unchanged. As you can see, crbankdb is made up of two documents that provide input to the dbadmin and sql shell commands. The first here file is passed to the BEA Tuxedo system command dbadmin to create a device list for the database.

This command does not work with non-BEA Tuxedo resource managers. Other commands may be needed to create table spaces and/or grant the correct privileges.

How to Change the Configuration File

In the GROUPS section, specify appropriate values (that is, values that are recognized by your resource manager) for the TMSNAME and OPENINFO parameters.