| Author: Durga Prasad 04 Dec 2008 | Member Level: Gold | Rating:  Points: 5 |
Connection pooling is a technique of creating and managing a pool of connections that are ready for use by any thread that needs them.
This technique of "pooling" connections is based on the fact that most applications only need a thread to have access to a JDBC connection when they are actively processing a transaction, which usually take only milliseconds to complete. When not processing a transaction, the connection would otherwise sit idle. Instead, connection pooling allows the idle connection to be used by some other thread to do useful work.
In practice, when a thread needs to do work against a MySQL or other database with JDBC, it requests a connection from the pool. When the thread is finished using the connection, it returns it to the pool, so that it may be used by any other threads that want to use it.
When the connection is "loaned out" from the pool, it is used exclusively by the thread that requested it. From a programming point of view, it is the same as if your thread called DriverManager.getConnection() every time it needed a JDBC connection, however with connection pooling, your thread may end up using either a new, or already-existing connection.
|
| Author: Deepika Haridas 05 Dec 2008 | Member Level: Diamond | Rating:  Points: 4 |
Hi,
If you indeed have 300 users connecting simultaneously, and a maximum setting of 300 connections, then connection pooling will not help. Connection pooling is meant to provide efficient re-use of connections - it will not increase the maximum you have available. The connection pool will reduce the load because it intercepts all the calls to the constructor/destructor. 300 Connections might not exceed your max limit but the resources used creating and destroying all those connections will kill the machine. Check out you webserver/OS documentation, You can set it up easily in Windows & Apache. You might wanna look at SQL Relay for Linux.
Regards, deepika
Thanks & Regards, Deepika Editor
If U want to shine like a SUN..First U have to burn like the SUN!! Need a Guide? Join my mentor program..
|
| Author: gowthami chowdary 06 Dec 2008 | Member Level: Gold | Rating:  Points: 5 |
Connection pooling is a technique of creating and managing a pool of connections that are ready for use by any thread that needs them.
This technique of "pooling" connections is based on the fact that most applications only need a thread to have access to a JDBC connection when they are actively processing a transaction, which usually take only milliseconds to complete. When not processing a transaction, the connection would otherwise sit idle. Instead, connection pooling allows the idle connection to be used by some other thread to do useful work.
In practice, when a thread needs to do work against a MySQL or other database with JDBC, it requests a connection from the pool. When the thread is finished using the connection, it returns it to the pool, so that it may be used by any other threads that want to use it.
When the connection is "loaned out" from the pool, it is used exclusively by the thread that requested it. From a programming point of view, it is the same as if your thread called DriverManager.getConnection() every time it needed a JDBC connection, however with connection pooling, your thread may end up using either a new, or already-existing connection.
|