Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

Using Database connection pooling with ADO

Hi,

I'm using Database connection pooling with ADO, by keeping one instance of a Connection object instantiated for each unique user. I'm writing in VC++ 6.0

How can I configure the max number of connections in the Database connection pooling?
How can I get the pool parameters (number of active connections, disconnected connections, etc.)?

Thanks
0
bachar
Asked:
bachar
1 Solution
 
TriskelionCommented:
What database brand?
0
 
bacharAuthor Commented:
Oracle 8.1.7
0
 
CJ_SCommented:
Don't know about Oracle, but I do know that keeping a connection alive for the session of a unique user is bad design. Open the connection when you need the connection and close it again when you are not sure that any database access can occur again. Keep the connection alive as short as possible!

CJ
0
What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

 
CJ_SCommented:
I assume though that Oracle also supports the Microsoft Distributed Transaction coordinator. That way you can see how many calls are being made, how many connections are open etc.

Not sure though if oracle supports it.

CJ
0
 
schwertnerCommented:
To  use Connection Pooling in Oracle 8i you have to congigure Oracle Multithreaded Server. It is easy - some changes in init.ora file.

Enabling Connection Pooling
In order to enable the connection pooling, additional parameters must be configured
for MTS_DISPATCHERS. The ideal scenario for connection pooling is networks on
which many clients run interactive “high idle, high search time” applications, such as
messaging and OLAP, and can afford to wait to get connected to a dispatcher. The
additional attributes to set for MTS_DISPATCHERS are detailed in the following
table.

To enable connection pooling, the init.ora
parameter MTS_DISPATCHERS must be configured.
mts_dispatchers =
“(PRO=TCP)(CON=20)(DIS=2)(POO=ON)(TIC=4)(SESS=35)”



POOL (POO)

This attribute is used to enable connection
pooling.
If a number is specified, then connection pooling is enabled for both
incoming and outgoing
network connections, and the number specified is the time-out in ticks
for both incoming and outgoing network connections.
If ON, YES, TRUE, or BOTH is specified, then “connection pooling”
is enabled for both incoming and outgoing network connections, and
the default time-out (set by Net8) is used for both incoming and
outgoing network connections
If IN is specified, then connection pooling is enabled for incoming
network connections, and the default time-out (set by Net8) is used for
incoming network connections.
If OUT is specified, then connection pooling is enabled for outgoing
network connections and the default time-out (set by Net8) is used for
outgoing network connections.
If NO, OFF, or FALSE is specified, then “connection pooling” is
disabled for both incoming and outgoing network connections. POOL
can also be assigned a name-value string such as: “(IN=10)”,
“(OUT=20)”, or “((IN=10)(OUT=20))”, in which case, if an IN
numeric value is specified, then connection pooling is enabled for
incoming connections, and the number specified is the time-out in
ticks for incoming network connections. If an OUT numeric value is
specified, then connection pooling is enabled for outgoing network
connections and the number specified is the time-out in ticks for
outgoing network connections. If the numeric value of a specified
time-out is 0, then the default value (set by Net8) is used.
The default connection pooling is disabled on both incoming and
outgoing network connections.
0
 
nico5038Commented:

No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
 - Answered by: schwertner
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
0
 
JgouldCommented:
Question has been closed as per recommendation

JGould-EE Moderator
0
 
schwertnerCommented:
Thank you very much!

 
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

What Kind of Coding Program is Right for You?

There are many ways to learn to code these days. From coding bootcamps like Flatiron School to online courses to totally free beginner resources. The best way to learn to code depends on many factors, but the most important one is you. See what course is best for you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now