Solved

Database connection pooling

Posted on 2013-01-25
1
211 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
I designed this idea while studying technology in the classroom.  This is a semester long project.  Students are asked to take photographs on a specific topic which they find meaningful, it can be a place or situation such as travel or homelessness.…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

10 Experts available now in Live!

Get 1:1 Help Now