3 Prerequisites
Before you begin, download the Transaction Manager for Microservices (MicroTx) installation bundle to your local system.
- Download the Installation Bundle
Perform the following steps to download the MicroTx installation bundle to your local system: - Clone the Sample Code Files
Clone the sample application files from the git repo to your local system. - Set Up XA-Compliant Resource Managers
If you want to run sample applications that use the XA transaction protocol, then you must set up XA-compliant resource managers and create tables with sample values. Skip this step if you don't want to run sample applications that use XA.
3.1 Download the Installation Bundle
Perform the following steps to download the MicroTx installation bundle to your local system:
The following folders are available.
lib
: This folder contains the MicroTx library files. You must use these library files in your application code to use MicroTx to manage transactions amongst your application microservices.otmm
: This folder contains the MicroTx image andYAML
files which you can use to install and configure MicroTx.console
: This folder contains the image file for the MicroTx console.
Parent topic: Prerequisites
3.2 Clone the Sample Code Files
Clone the sample application files from the git repo to your local system.
- Clone the git repo from https://github.com/oracle-samples/microtx-samples.
- View the available files and folders.
Parent topic: Prerequisites
3.3 Set Up XA-Compliant Resource Managers
If you want to run sample applications that use the XA transaction protocol, then you must set up XA-compliant resource managers and create tables with sample values. Skip this step if you don't want to run sample applications that use XA.
You can use any Oracle Database. For example, Autonomous Transaction Processing (ATP) Database instances in Oracle Cloud, an Oracle Database running inside a Kubernetes cluster, or an on-premises database. Ensure that application, when it is deployed, can access the database.
Create database and tables with sample values
Run SQL script files to test the sample XA applications, create database and tables with sample values for both the department applications. The SQL script files are available in the microtx-samples
GitHub repository. Run the SQL script using a client tool with which you connect to the database. To run the scripts, you must either be a database administrator or have the required privileges to create and run DMLs. You'll also need to provide database credentials to establish a connection with the database and run the SQL script.
To use the SQL script to create a database, a table, and populate it with sample values:
- Open the
department.sql
file in any code editor and replace<password>
with the database administrator's password. This file is located in thexa/java/department-helidon
folder in themicrotx-samples
GitHub repository. - Run the
department.sql
file by connecting to Oracle Database using SQL developer or SQL plus.This creates a database with the name
department_helidon
and a table with the nameaccounts
. It also populates theaccounts
table with sample values. - Open the
department.sql
file in any code editor and replace<password>
with the database administrator's password. This file is located in thexa/java/department-spring
folder in themicrotx-samples
GitHub repository. - Run the
department.sql
file by connecting to Oracle Database using SQL developer or SQL plus.This creates a database with the name
department_spring
and a table with the nameaccounts
. It also populates theaccounts
table with sample values as provided in the following table.Account_ID Amount account1 1000 account2 2000 account3 3000 account4 4000 account5 5000
Parent topic: Prerequisites