What is the difference between Connection from DataSource getconnection () and a Mysql session?

I wonder if every time I get a connection from a DataSource with ds.getConnection (), is a new session being created between my application and the MySQL instance or is there some reuse logic?

+4
source share
1 answer

Each Connection object created by a DataSource is a database connection — a session in the database.

The maximum number of connections with which the database is configured supports restrictions on the number of active connection objects that the application can open simultaneously with the database.

, , Connection Connection . .

. Java DataSource.

+3

Source: https://habr.com/ru/post/1610380/


All Articles