Book Image

Wildfly Cookbook

Book Image

Wildfly Cookbook

Overview of this book

Table of Contents (23 chapters)
WildFly Cookbook
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Setting a connection pool


As in the previous recipe, sometimes we need to extract some information regarding the behavior of database integration. Many times, when your application's concurrent users are in the order of hundreds or thousands, you have to serve multiple DB connections at a time. This is exactly what we will learn in this recipe, using the CLI.

Getting ready

Think of a connection pool like a bucket pre-filled with a minimum number of ready-to-use connections for your application. There is also an upper bound limit that defines the maximum number of connections that the pool can hold. The default values for the minimum and maximum size of the pool are 0 and 20 respectively, with the prefill attribute set to false by default. This means that when a datasource is started up, its connection pool is created with 0 active and valid connections, and that it can hold up to 20 connections.

Why would you use a connection pool? Because creating a connection involves a lot of things under...