It's a technique to allow multiple clinets to make use of a cached set of shared and reusable connection objects providing access to a database. Connection Pooling feature is supported only on J2SDK 1.4 and later releases.

Opening/Closing database connections is an expensive process and hence connection pools improve the performance of execution of commands on a database for which we maintain connection objects in the pool. It facilitates reuse of the same connection object to serve a number of client requests. Every time a client request is received, the pool is searched for an available connection object and it's highly likely that it gets a free connection object. Otherwise, either the incoming requests are queued or a new connection object is created and added to the pool (depending upon how many connections are already there in the pool and how many the particular implementation and configuration can support). As soon as a request finishes using a connection object, the object is given back to the pool from where it's assigned to one of the queued requests (based on what scheduling algorithm the particular connection pool implementation follows for serving queued requests). Since most of the requests are served using existing connection objects only so the connection pooling approach brings down the average time required for the users to wait for establishing the connection to the database.

간단히 설명하면..  풀장에 코넥션 object를 만들어 놓고 클라이언트의 요구가 올때마다 코넥션 object가 request를 받아 처리한다는 내용이다.

클라이언트의 요청이 도착할 때 마다 풀은 가용한 코넥션 오브젝트를 찾는다. 만약 못찾으면 큐에 저장되어 대기 하거나 새로운 코넥션을 만든다.,(이는 사용자 configuration에 따라 선택된다). 코넥션 풀을 사용함으로서 얻을 수 있는 효과는 일반적인 방법을 사용할때  database를 접근하기 위해 connection을 만드는 average time 을 절감 할 수 있다는 것이다.

'데이터베이스 > mysql' 카테고리의 다른 글

mysql connection pool?  (0) 2015.03.27
dmysql 사용시 timestamp와 datetime의 차이  (0) 2015.03.27
블로그 이미지

종환 Revolutionist-JongHwan 항상 겸손하자.

댓글을 달아 주세요