Database connections in depth / Sponsor

RSS

Database connections in depth

Story by John Goodson and Rob Steward, 09-07-2009, 1 comment

How Connection Pooling Works

In a pooled environment, once the initial physical connection is established, it will likely not be closed for the life of the environment. That is, when an application disconnects, the physical connection is not closed; instead, it is placed in the pool for reuse. Therefore, re-establishing the connection becomes one of the fastest operations instead of one of the slowest.

Here is a basic overview of how connection pooling works:

1. When the application or application server is started, the connection pool is typically populated with connections.
2. An application makes a connection request.
3. Either the driver or the Connection Pool Manager (depending on your architecture) assigns one of the pooled connections to the application instead of requesting that a new connection be established. This means that no network round trips occur between the driver and the database server for connection requests because a connection is available in the pool. The result: Your connection request is fast.
4. The application is connected to the database.
5. When the connection is closed, it is placed back into the pool.
Guidelines for Connection Pooling

Here are some general guidelines for using connection pooling. 

A perfect scenario for using connection pooling is when your applications reside on an application server, which implies multiple users using the applications. 

Consider using connection pooling if your application has multiple users and your database server has enough memory to manage the maximum number of connections that will be in the pool at any given time. In most connection pooling models, it is easy to calculate the maximum number of connections that will be in a pool because the connection pool implementation allows you to configure the maximum. If the implementation you are using does not support configuring the maximum number of connections in a pool, you must calculate how many connections will be in the pool during peak times to determine if your database server can handle the load. 

Determine whether the number of database licenses you have accommodates a connection pool. If you have limited licenses, answer the following questions to determine if you have enough licenses to support a connection pool:
a. ‑Will other applications use database licenses? If yes, take this into account when calculating how many licenses you need for your connection pool.
b. ‑Are you using a database that uses a streaming protocol, such as Sybase, Microsoft SQL Server, or MySQL? If yes, you may be using more database connections than you think. In streaming protocol databases, only one request can be processed at a time over a single connection; the other requests on the same connection must wait for the preceding request to complete before a subsequent request can be processed. Therefore, some database driver implementations duplicate connections (establish another connection) when multiple requests are sent over a single connection so that all requests can be processed in a timely manner. 

When you develop your application to use connection pooling, open connections just before the application needs them. Opening them earlier than necessary decreases the number of connections available to other users and can increase the demand for resources. Don’t forget to close them when the database work is complete so that the connection can return to the pool for reuse.

Next Page: When Not to Use Connection Pooling

Previous page


SHARE THIS.
yclkipqeup TaXvMzzsxFNgXVzLs on 11.03.2010 at 15:18

aU7JQ4 fjvdtqbvagbc, [url=http://xkdxftczdyjt.com/]xkdxftczdyjt[/url], [link=http://lnmqiwhjlvpz.com/]lnmqiwhjlvpz[/link], http://mbyutrbvqtsh.com/

Request further information







500 characters left

Verification Image




Request further information







500 characters left

Verification Image

SIGN UP.

Sign up to receive the latest news and updates from Server-Management via email.

News & Features Feed
Viewpoints Feed
FOLLOW US.
OUR SPONSOR.
Top 10 Most Popular Articles
Top 5 Jobs
IT Manager - ITIL, Infrastructure, Operations - Kent
Posted:
2010-03-12
Location:
Kent, South East
Salary range:
45000 - 55000
Salary period:
year
Description:

We urgently need an experienced IT Manager with strong people management skills (team of 15) and with a solid appreciation of IT infrastructures and IT operations to join the management team within this leading organisation. The remit will be to be drive ITIL best practice across the IT infrast... read more

IT Manager-WMS
Posted:
2010-03-12
Location:
Derbyshire, Derbyshire
Salary range:
55000 - 60000
Salary period:
year
Description:

On behalf of a large blue chip client we are looking for an IT Manager with an in depth understanding of WMS remote data capture, warehouse automation and the “black box technology” utilised to provide seamless interfaces. This is a challenging role which requires a number... read more

IT Manager
Posted:
2010-03-12
Location:
127, UK, London, London
Salary range:
60000 - 70000
Salary period:
year
Description:

My London based legal client is looking to recruit an IT manager. The role of the IT manager will be both technically hands on and a managerial role, with 3 direct reports. The IT manager will have to present business cases to the partners, lead the current team, bring new ideas and vision for ... read more

IT Technician
Posted:
2010-03-12
Location:
Sheffield, South Yorkshire
Salary range:
20000 - 25000
Salary period:
year
Description:

PLEASE DO NOT APPLY UNLESS YOU HAVE A LEGAL BACKGROUND. IT Technician (Legal) Sheffield £20-25k The Job Role: We are looking for a network administrator who will be able to maintain and support the systems our client has in place providing services to their team. The Systems Administ... read more

IT Support - Telephony Manager
Posted:
2010-03-12
Location:
Basildon, Essex
Salary range:
19000 - 20000
Salary period:
year
Description:

We our looking for an IT Support + Telephony Manager to manage the IT Support function to ensure that all objectives are met on a daily, weekly and monthly basis. Our Client is a customer focused business, entrepreneurial and flexible organisation whose people are seasoned in the various discip... read more


Want to advertise here? Follow me!