- Pool is a collection of reserved resources.
- Same collection object can be reused multiple times.
- If we required to communicate with database multiple times, then it is not recommended to create a separate connection object every time because and destroying connection object. Every time creates performance problems.
- To overcome above problem, we use connection pool.
- Connection is a pool of already created connection objects
- We request connection to provide connection object object whenever we want to communicate with database. After completing our work, we return the connection back to the pool instead of destroying it.
- Reusing same connection, object helps to improve performance
- Implementing connection pool
- Connection pool is implemented by creating a data source object like DriverManagerDataSource, HikariDataSource,ComboPooledDataSource(c3p0).
- Data source is responsible to manage connections in the connection pool.
- Driver vendor is responsible to provide implementation.
- Driver Manager versus Data source object
- When we create object from driver Manager, it always creates new connection object
- Con=DriverManager.getConnection(url,name,pwd)
- When we create object from data source, it provides connection from data pool.
- Con=DS.getConnection();
- Performance wise data source is a better approach.
- Examples
- Annotations
- Controllers
- Components
- Dependencies
- Documenting Java Code
- Entities
- Hibernate
- HTTPS Security
- Spring Core
- Maven
- Spring MVC
- Microservices
- Packages
- Project Configuration
- REST Templates
- Spring Boot
- AOP
- Spring DI
- Spring IOC
- Spring Data
- Tag Library
- View Resolvers
- Validations,Errors & Exceptions
- Activiti Framework
- Deploy spring boot Microservices in Fargate
- Spring Security
- Password encryption using Jasypt
- Flyway DB Migration Script
- Session in Spring Boot
- Spring Expression Language
- Spring JDBC
- Spring ORM
- Testing Spring Boot
- Correlation ID
- Logging
- ELK Stack
- EFK Stack
- Swagger
- Rabbit MQ
- Circuit Breaker Pattern
- Connection Pooling
- Spring Batch
- Zipkins
- Kafka
- Spring Boot Actuator
- Spring Cloud
- Caching
- Gateway
- Service Discovery
Connection Pooling
Subscribe to:
Posts (Atom)
Spring Boot
What is circular/cyclic dependency in spring boot? When two services are interdependent on each other, that is to start one service, we requ...
-
What is JPA? JPA Is also called as Java persistence API It is a standard form oracle to map object to database relations. Provides specific...
-
Technology's / frameworks in Spring Spring core Spring MVC Spring boot Spring data Hibernate
-
Q What is the minimal web version required to use JSTL? And : 2.4 For example following tag from web.xml uses web 4.0 <web-app xmlns:xs...
No comments:
Post a Comment