Marco Toscano FreireJava Expert · Open Source Addict
Inicio › JDBC Connection Pool - Resource Type Datasources

JDBC Connection Pool - Resource Type Datasources

📅 31 agosto 2018✍ Marco Toscano Freire
When we need to configure the connection pool on Glassfish or Payara Server, could be that the Resource Types Datasources options are not clear. Because in this post I going to explain the differences between them.
Resource Types Datasource

  • javax.sql.Datasource.- This datasource type is used in applications that manage a global transaction that always involves just one resource. Sometimes called local transactions. This datasource is related with No-XA Transaction.
  • javax.sql.XADatasource.-  This datasource type is used in applications that manage distributed transactions with one or more databases or other resources like JMS. This datasource is related with XA Transaction.
  •  javax.sql.ConnectionPoolDatasource.- This datasource type is more general, produces a connection (PooledConnection) object that will automatically participate in connection pooling. This implementation works with a middle-tier connection pooling, generally isn't used by a programmer.
JDBC Connection Pool - Resource Type Datasources

Datasource Hierarchy (Ref: shengwangi)


connectionpooldatasourcedatasourceglassfishjavajdbcjdbc connection pooljeepayarapool connectionxadatasource