October 2018
Intermediate to advanced
556 pages
15h 18m
English
Modern applications rarely create a JDBC connection directly. More often, connection pools are used. The reason behind this is pretty simple—establishing a new connection is costly. Consequently, it is wise to have a cache of connections managed in the way that allows reuse. The cost of creating a connection may come from two areas. First of all, the connection initiation process may require client authentication and authorization, and this takes up precious time. Secondly, a new connection may cost a database a fortune. For example, PostgreSQL creates a whole new process (not a thread!) whenever a new connection is established, which itself may take hundreds of milliseconds on a powerful Linux machine. At the time of ...