Recently, I tried the connection pool function of Pro * C in Oracle9i, and the more I get confused:
1. First, add the following options to the compilation parameters of Proc:
Threads = Yes Multithreading
Cpool = yes use the connection pool
Cmax = 6 up to 6 Connections
Cmin = 4 at least 4 connections
Cincr = 1 Add a connection each time
Ctimeout = 2: The time for deleting an inactive connection. Delete the inactive connection within 2 seconds.
Cnowait = 1 Number of reconnections when the connection fails
2. Write a simple connection to the Oracle database in the program. Press the Enter key to close the Connection Program.
The following features are found:
1. After using the connection pool option, query the V $ session view in the Oracle database before connecting to the database, and find that no connection exists in the test program;
2. After connecting to the database for the first time, query the V $ session view and find that the test program has a Cmin + 1 connection (5 connections)
3. If you continue to connect to the database, the number of connections will increase continuously. The number of connections can exceed the Cmax value, and the total number of connections = Cmin + number of connections;
4. Close the database connection. After closing all the connections, check that there are still Cmin connections in the V $ session;
5. After the entire program exits, all connections will disappear from the V $ session.
I am very confused about proc's connection pool function. In information, the connection pool function provides many logical connections, but only a few physical connections are provided internally, improve performance by reducing the number of physical connections and increasing the speed of logical connections. However, from the experiment, the number of physical connections in the Oracle database has not changed. Maybe I should perform a performance test to check whether the program performance has improved after the connection pool option is enabled. Maybe I have used Oracle9i, maybe 10 Gb will fully support this function ............
Please be clear about how to use the Pro * C connection pool. Thank you!