Javatpoint Logo

what is connection pooling? where it is used?& how it is created?

By: prkann*** On: Mon Mar 24 22:32:28 IST 2014     Question Reputation0 Answer Reputation5 Quiz Belt Series Points0  5Blank User
In Real Time what's the purpose of connectinpoolingUp0Down

 
The connection pool is used to direct JDBC calls within the application, as well as for enterprise beans using the database.

Benefits of connection pooling

Connection pooling can improve the response time of any application that requires connections, especially Web-based applications. When a user makes a request over the Web to a resource, the resource accesses a data source. Because users connect and disconnect frequently with applications on the Internet, the application requests for data access can surge to considerable volume. Consequently, the total datastore overhead quickly becomes high for Web-based applications, and performance deteriorates. When connection pooling capabilities are used, however, Web applications can realize performance improvements of up to 20 times the normal results.

With connection pooling, most user requests do not incur the overhead of creating a new connection because the data source can locate and use an existing connection from the pool of connections. When the request is satisfied and the response is returned to the user, the resource returns the connection to the connection pool for reuse. The overhead of a disconnection is avoided. Each user request incurs a fraction of the cost for connecting or disconnecting. After the initial resources are used to produce the connections in the pool, additional overhead is insignificant because the existing connections are reused.

When to use connection pooling

Use WebSphere connection pooling in an application that meets any of the following criteria:

It cannot tolerate the overhead of obtaining and releasing connections whenever a connection is used.
It requires Java Transaction API (JTA) transactions within WebSphere Application Server.
It needs to share connections among multiple users within the same transaction.
It needs to take advantage of product features for managing local transactions within the application server.
It does not manage the pooling of its own connections.
It does not manage the specifics of creating a connection, such as the database name, user name, or password
Image Created0Down

By: [email protected] On: Tue Mar 25 10:17:47 IST 2014 Question Reputation0 Answer Reputation359 Belt Series Points0 359User Image
Are You Satisfied :0Yes0No
 

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.


It described when connections are created. It described how several Context instances can share the same connection. In this type of sharing, operations from the different Context instances are multiplexed onto the same connection.

You can control the degree of sharing by deciding when to create a new initial context and when to obtain a derived Context instance from an existing Context instance. This type of connection sharing satisfies most applications.
Image Created0Down

By: [email protected] On: Tue Mar 25 14:32:32 IST 2014 Question Reputation0 Answer Reputation392 Belt Series Points0 392User Image
Are You Satisfied :0Yes0No