Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Database connection pooling

Posted on 2013-01-25
1
Medium Priority
?
218 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

609 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