WildFly uses a pool of Database Connection objects to your applications. A Connection Pool is a way to reduce the cost of opening and closing Database connections by maintaining a Pool of Database connections. In this article we will learn how to configure WildFly Connection Pool in an optimal way.
WildFly Datasource configuration
A javax.sql.DataSource objects simplifies access to a Database by implementing classes that allow you to use connection pool.
In WildFly, the DataSource object is available in all server configurations through the datasources subsystem. Out of the box, an H2 Datasource is available for testing purposes.
You can learn more about DataSource Configuration through the following resources:
DataSource set up
How to set up a Datasource with WildFly
How to configure the DataSource Connection pool
Configuring Agroal Datasource on WildFly
Creating a Datasource using a CLI script
Creating a Datasource using the Web Console
Hardening a DataSource
How to validate Database connections in JBoss / WildFly
How to encrypt the Datasource password
Monitoring / Troubleshooting
How to trace JDBC statements with JBoss and WildFly
Solving “No managed connections available within configured blocking timeout”
Using try-with-resources to close database connections
DataSource and Enterprise applications
How to deploy a DataSource in jboss at application level
How to inject a DataSource in your Enterprise applications
Advanced topics
Configuring Datasource JTA and XA settings
How do I access the specific driver Connection with JBoss
Database specific tutorials
Configuring a PostgreSQL DataSource
Configuring MS SQLServer DataSource
Configuring a MySQL DataSource
H2 Database Tutorial and expert Tips
H2 DB is an open source lightweight Database written in Java. It ships in JBoss EAP and WildFly application server to speed up developing and testing Java applications. Let’s have a look to the main configuration options and how to create an example application using the H2 DB. What is H2 database? Firstly, let’s see … Read more
How to validate Database connections in JBoss / WildFly
This tutorial discusses how to validate database connections using in WildFly so that you can manage reconnection to the database in case of temporary failures. Connection Validation in a nutshell A datasource connection validation helps to ensure that the connections to the database are still valid. The strategy behind connection vaidation is to periodically test … Read more
How to encrypt WildFly Datasource password
In this tutorial we will learn how to protect sensitive data such as the Datasource password in WildFly. At first, we will learn the recommended approach, using Credential Stores. Then, for older WildFly installation, we will use PicketBox to encrypt the datasource password.
Configuring a Datasource with MySQL on WildFly
In this tutorial we will learn how to install and configure a Datasource on WildFly which uses MySQL or MariaDB as Database. MySQL set up In order to install MySQL, please follow the Installation Guide available: https://dev.mysql.com/doc/mysql-getting-started/en/#mysql-getting-started-installing As an alternative, if you have available docker, you can start a MySQL instance in a minute with: … Read more
How to solve “Unable to get managed connection” error
Scenario: You are unable to fetch connections from the Database and the server log shows the error “Unable to get managed connection for <DataSource>” .
How to trace JDBC Statements performance in MySQL
In this quick article we will learn an handy option which is available in MySQL JDBC Driver to debug and profile SQL statements run by Java applications.
How to configure a Datasource programmatically
This article covers how to define a Datasource resource programmatically using the DataSourceDefinition annotation. Then, we will show to to use the Datasource to connect to a Relational Database and execute SQL Statements.
Configuring a datasource with PostgreSQL and JBoss/WildFly
This tech tip shows how you can install and configure PostgreSQL with JBoss / WildFly going into the details of PostGreSQL installation, configuration and tuning. We will also learn how to configure hibernate postgresql dialect in a JPA application. Installing PostgreSQL We will assume that you are running on a Linux machine. Firstly, install PostgreSQL: $ … Read more
What you need to know about CVE-2021-42392
H2 Console in versions between 1.1.100 and 2.0.204 is vulnerable as it allows loading of custom classes from remote servers through JNDI, like the Log4Shell vulnerability. Let’s see in detail the issue and how this can affect our environment.