Book Image

Mastering JBoss Enterprise Application Platform 7

By : Francesco Marchioni, Luigi Fugaro
Book Image

Mastering JBoss Enterprise Application Platform 7

By: Francesco Marchioni, Luigi Fugaro

Overview of this book

The JBoss Enterprise Application Platform (EAP) has been one of the most popular tools for Java developers to create modular, cloud-ready, and modern applications. It has achieved a reputation for architectural excellence and technical savvy, making it a solid and efficient environment for delivering your applications. The book will first introduce application server configuration and the management instruments that can be used to control the application server. Next, the focus will shift to enterprise solutions such as clustering, load balancing, and data caching; this will be the core of the book. We will also discuss services provided by the application server, such as database connectivity and logging. We focus on real-world example configurations and how to avoid common mistakes. Finally, we will implement the knowledge gained so far in terms of Docker containers and cloud availability using RedHat's OpenShift.
Table of Contents (20 chapters)
Mastering JBoss Enterprise Application Platform 7
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface

Defining an XA-datasource


There is not much difference between creating a datasource and an XA-datasource. The main differences between these two kinds of data source are linked to subsystem configuration and transactions.

The same concepts explained for the Data-source also apply to the XA-datasource, so we will just see how to define and configure an XA-datasource.

To create an XA-Datasource, you can start with a basic configuration, as follows:

  • Its name

  • The JNDI name - used by the application to reference it

  • The connection properties - connection information to the database are provided as properties, instead of a URL

  • The credentials to access the database (username and password)

  • The driver to use

Connect to the CLI and do as follows:

xa-data-source add --name=MySQLXADS --jndi-name=java:jboss/MySQLXADS --driver-name=mysql --user-name=root --password=root --xa-datasource-properties={"ServerName"=>"192.168.59.104","DatabaseName"=>"mysql"} 

The preceding command should have added the xa-data...