Solved

Database connection pooling

Posted on 2013-01-25
1
214 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 75

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

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to repeat the data 4 40
itextsharp with c# 3 32
c#, case, if 4 34
C# DateTime Help 6 43
This article describes a simple method to resize a control at runtime.  It includes ready-to-use source code and a complete sample demonstration application.  We'll also talk about C# Extension Methods. Introduction In one of my applications…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

740 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