Solved

Database connection pooling

Posted on 2013-01-25
1
210 Views
Last Modified: 2013-01-25
Hi all,

I have an application that needs to process dozens of incoming messages a second.
Each message needs to be analyzed, which requires several reads/writes to a DB2 database.

For each message that I receive, I create a thread, create and open a database connection,
do the processing and close the connection.

How can I manage the connection(s) to the database more efficiently?

Here's my connection string (just in case):
"Provider=IBMDADB2; Database = db; Hostname = 192.182.162.2; Protocol = TCPIP; Port = 50000; Uid = db; Pwd = pwd"

Any help is appreciated
0
Comment
Question by:darrgyas
1 Comment
 
LVL 74

Accepted Solution

by:
käµfm³d   👽 earned 500 total points
ID: 38818527
This is the preferred practice. According to documentation on IBM's website, you get connection pooling with DB2 the same as you do with other DBMSs. Even though you are creating a new connection object on demand, the underlying TCP connection isn't closed (right away). Creating a new connection object will use this TCP connection if it's available; otherwise a new connection will be created and added to the pool.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction                                                 Was the var keyword really only brought out to shorten your syntax? Or have the VB language guys got their way in C#? What type of variable is it? All will be revealed.   Also called…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now