Berkeley DB Reference Guide: XA Resource Manager
Description: Berkeley DB: An embedded database programmatic toolkit.
Keywords: embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++

### Berkeley DB Reference Guide: XA Resource Manager |

# Configuring Berkeley DB with the Tuxedo System

This information assumes that you have already installed the Berkeley DB library.

First, you must update the resource manager file in Tuxedo. For the purposes of this discussion, assume the Tuxedo home directory is in:

>     /home/tuxedo

In that case, the resource manager file will be located in:

>     /home/tuxedo/udataobj/RM

Edit the resource manager file, adding the following line:

>     BERKELEY-DB:db_xa_switch:-L${DB_INSTALL}/lib -ldb \
>     	-lsocket -ldl -lm

where ${DB_INSTALLHOME} is the directory into which you installed the Berkeley DB library.

Note, the above load options are for a Sun Microsystems Solaris 5.6 Sparc installation of Tuxedo, and may not be correct for your system.

Next, you must build the transaction manager server. To do this, use the Tuxedo buildtms(1) utility. The buildtms utility will create the Berkeley-DB resource manager in the directory from which it was run. The parameters to buildtms should be:

>     buildtms -v -o DBRM -r BERKELEY-DB

This will create an executable transaction manager server, DBRM, that is called by Tuxedo to process begins, commits, and aborts.

Finally, you must make sure that your TUXCONFIG environment variable identifies a ubbconfig file that properly identifies your resource managers. In the GROUPS section of the ubb file, you should identify the group's LMID and GRPNO as well as the transaction manager server name "TMSNAME=DBRM." You must also specify the OPENINFO parameter, setting it equal to the string:

>     rm_name:dir

where rm_name is the resource name specified in the RM file (i.e., BERKELEY-DB) and dir is the directory for the Berkeley DB home environment (see DBENV->open for a discussion of Berkeley DB environments).

As Tuxedo resource manager startup accepts only a single string for configuration, any environment customization that might have been done via the config parameter to DBENV->open must instead be done by placing a DB_CONFIG file in the Berkeley DB environment directory. See Berkeley DB File Naming for further information.

Consider the following configuration. We have built a transaction manager server as described above. We want the Berkeley DB environment to be /home/dbhome, our database files to be maintained in /home/datafiles, our log files to be maintained in /home/log, and we want a duplexed server.

The GROUPS section of the ubb file might look like:

>     group_tm LMID=myname GRPNO=1 TMSNAME=DBRM TMSCOUNT=2 \
>     	OPENINFO="BERKELEY-DB:/home/dbhome"

There would be a DB_CONFIG configuration file in the directory /home/dbhome that contained the following two lines:

>     DB_DATA_DIR	/home/datafiles
>     DB_LOG_DIR	/home/log

Finally, the ubb file must be translated into a binary version, using Tuxedo's tmloadcf(1) utility, and then the pathname of that binary file must be specified as your TUXCONFIG environment variable.

At this point, your system is properly initialized to use the Berkeley DB resource manager.

See db_create for further information on accessing data files using XA.

Copyright Sleepycat Software