Connection Pooling is a concept of managing DB connections in the server side to ensure the maximum no. of connections cannot breach with the configured no. of connections. And it manages the idle connections (those are not actively in used) in the pool ready to reuse. In the existing ICA Tool system, when user can access that no. interfaces (which was defined in a configuration file) at a time and after that if they want to access a new interface, it will not allow end user to do anything. And at last user needs to restart tomcat server to release/reset the connections. With the implementation of connection pooling, we can overcome existing problem.
A Review of Connection Pooling Implementation in ICA Tool
1. A REVIEW OF CONNECTION POOLING IMPLEMENTATION IN ICA TOOL
Mtech(IT),Utkal University,Odisha
ABSTRACT
Connection Pooling is a concept of managing DB connections in the server side to ensure the
maximum no. of connections cannot breach with the configured no. of connections. And it
manages the idle connections (those are not actively in used) in the pool ready to reuse. In the
existing ICA Tool system, when user can access that no. interfaces (which was defined in a
configuration file) at a time and after that if they want to access a new interface, it will not allow
end user to do anything. And at last user needs to restart tomcat server to release/reset the
connections. With the implementation of connection pooling, we can overcome existing problem.
Keywords:Connection Pooling, Database connection,JDBC ,Tomcat server
1. PURPOSE
Connection Pooling is a concept of
managing DB connections in the server
side to ensure the maximum no. of
connections cannot breach with the
configured no. of connections. And it
manages the idle connections (those are
not actively in used) in the pool ready to
reuse. In the existing ICA Tool system,
when user can access that no. interfaces
(which was defined in a configuration
file) at a time and after that if they want
to access a new interface, it will not
allow end user to do anything. And at
last user needs to restart tomcat server to
release/reset the connections. With the
implementation of connection pooling,
we can overcome existing problem.
2. SCOPE
Using connection pooling in ICA Tool,
we can manage the database connections
robustly, and as per connection pooling
it ensures the no of connections are not
breaching the defined nos. So server
should run smoothly and no need to
restart it and more to that user can use
more no of interfaces.
We had some analysis over the type of
connection pooling to use in various
applications. Generally we took (a)
Commons DBCP (b) C3P0 and (c)
Oracle UCP into consideration.
3. FEATURES
We went over internet to find the best
one that will suit for our multi-threaded
applications.
Internaltional Journal of Advanced Research in Computer Sceience and Applications
Vol.1, Issue 5, November 2013
ISSN: 2321-872X-Online 2321-8932- Print
www.ijarcsa.org admin@ijarcsa.org
w
w
w
.ijarcsa.org
22
Nishanta Ranjan Nanda Prav at Sutar
Senior System Engineer, IBM India Pvt L imited, Kolkata
1
2
1 2
2. However, according to the sources, we found that
C3P0 DBCP
It is better for multithreaded
environment.
It is better suited to single-
threaded applications with high
load
C3p0 doesn’t actually make a
connection available in the pool when
it is checked- in. Instead the Helper
Threads will detect these and do the
work to get them back.
This is missing in case of DBCP.
It robustly handles DB disconnects and
transparent reconnects on resume.
It never recovered connections if
the link was taken out from it.
Regarding Oracle UCP, we did not
find much comparison. But some sites
suggested that Oracle UCP does not
fully support JDK 6/ojdbc6.jar. We are
not considering this as it can create
problem when we upgrade Java versions
in future.
4. IMPLEMENTATION
From this analysis, we decided to use
C3P0 Connection pooling mechanism in
our applications. We did a POC to
observe the behavior of number of
connections to the database and it seems
like the number of connections do not
exceed over the maximum number of
connections mentioned. Each
connection is properly allocated and de-
allocated by the connection pooling
mechanism.
The dependent jar files are:
1) mchange-commons-java-0.2.3.4.jar
2) c3p0-0.9.2.1.jar
The sample Connection Pooling class is
attached herewith.
5. OUTPUT
After implementing connection pooling
in ICA Tool, It overcomes below
existing limitations of ICA Tool.
(a) In the existing application, the
connections were not reused properly.
But with the new implementation, the
same is reused as and when required and
never exceeds the MAX connection i.e.
6 mentioned in the configuration file.
The connection opens and releases so
efficiently.
(b) The existing application never allows
the user to login when it exceeds the
maximum connection. From the testing
it is found that user can open 10 to 12
windows (not more that that) but with
the new implementation, it allows the
user to open more number of windows.
We have tested opening around 25
refreshable windows. Nevertheless, the
idle connection still exists in the pool.
This ensures that we can further open
more number of windows.
We could open 25 refreshable windows.
Below is the screen shot.
Internaltional Journal of Advanced Research in Computer Sceience and Applications
Vol.1, Issue 5, November 2013
ISSN: 2321-872X-Online 2321-8932- Print
www.ijarcsa.org admin@ijarcsa.org
w
w
w
.ijarcsa.org
23
3. [Figure Showing 25 refreshable windows]
(c) In the existing application, the
connection object was made instance
specific. For this reason, the connection
object was not being released properly.
With the new implementation, this fix is
in place. The connection object releases
so efficiently.
Below is the log detail.
[Figure showing log details]
(d) The existing application encounters
some sort of problems. When all the
connections are in use in the pool and
the next request comes, it throws an
error “Maximum Number of
Connection Reached”. This is not the
general behavior of Connection pooling
Mechanism. With the new
implementation, when all the
connections are in use in the pool and
any further request comes, the request
waits till it gets any released connection.
Internaltional Journal of Advanced Research in Computer Sceience and Applications
Vol.1, Issue 5, November 2013
ISSN: 2321-872X-Online 2321-8932- Print
www.ijarcsa.org admin@ijarcsa.org
w
w
w
.ijarcsa.org
24
4. [Figure showing Opened 20 refreshable windows]
Observed the log file for active and idle connections. Even after opening 20 windows, there
are still 3 idle connections.
[Figure showing log details]
Earlier we had a test where we opened 25 refreshable windows without encountering any
kind of connection disruption with the database. Below is the screen shot.
Internaltional Journal of Advanced Research in Computer Sceience and Applications
Vol.1, Issue 5, November 2013
ISSN: 2321-872X-Online 2321-8932- Print
www.ijarcsa.org admin@ijarcsa.org
w
w
w
.ijarcsa.org
25
5. 6. REFERENCE
Few sites are given below for references.
http://javatech.org/2007/11/c3p0-vs-dbcp-the-straight-dope/
http://cloverink.net/tag/apache-commons-dbcp/
http://www.questiondb.com/questions/2423490/how-good-is-oracle-universal-connection-
pool-ucp
Internaltional Journal of Advanced Research in Computer Sceience and Applications
Vol.1, Issue 5, November 2013
ISSN: 2321-872X-Online 2321-8932- Print
www.ijarcsa.org admin@ijarcsa.org
w
w
w
.ijarcsa.org
26