hi.
i compile the demo application "pool.c" with vc6 and modify it's minconn to 5.
when i run it, i find five connection with database by firewall,
but only one connection working.
and another problem,it's spending too much time during "OCI_ConnPoolGetConnection(data)" ;
lib COMPILE: win2003 vc2005
pool.c COMPILE: WIN2003 vc6
pool.exe RUN: WIN2003
DB: ORACLE 11G the same as LINUX or WIN2003
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> when i run it, i find five connection with database by firewall
Normal you asked for a pool of 5 connections
> but only one connection working
Normal you're using only one connection
> it's spending too much time during "OCI_ConnPoolGetConnection(data)"
The first attempt to get a connection from the pool is expensive because 5 connections are physically created by OCI..
Further call to get a connection will return quicky becauseif you've got connection ready to be used in the pool.
That's the idea behing 'connection pooling'
Vincent.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The problem i can not understood is after the pool created,I create (MAX_THREADS 50) work threads, they are blocked calling OCI_ConnPoolGetConnection API,and only one connection transfer data with database server. and max_conn not reached.
Just the sql querys on a established connetion can return quickly.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi.
i compile the demo application "pool.c" with vc6 and modify it's minconn to 5.
when i run it, i find five connection with database by firewall,
but only one connection working.
and another problem,it's spending too much time during "OCI_ConnPoolGetConnection(data)" ;
lib COMPILE: win2003 vc2005
pool.c COMPILE: WIN2003 vc6
pool.exe RUN: WIN2003
DB: ORACLE 11G the same as LINUX or WIN2003
Hi Vincent.
I use ocilib 2.5.1 and already set OCI_ENV_THREADED flag.
It is realy one physical database connection working,
Shall you email me the compiled pool.exe to me,just let me make a test.
Hi,
Okay, i'll send you an executable later today...
You can send me as well your project used to compile the pool demo. I'll try to compile it on my config.
And give me more details :
Your OS ?
Your compiler ?
Your Client version of Oracle ?
Your Server version of Oracle ?
Vincent.
Sorry, i forgot you already gave versions details...
Did you configure your projet for mutltithreading in the complier options ??
Send me the VC6 project file used to the pool demo....
Thank you Vincent.
I have sent the files by your sf email address,Not sure whether you can recived.
Hi,
I got your mail...
I build your project with VC6.... I had to modify the link reference from ocilib.lib to ociliba.lib
But when i tested, it ran fine !....
I saw that in your project setting, you were generating the app test in single thread debug...
You can modify to multithread.... And check again...
OH let me check it,
Thanks again that excuse me for taking your time.
Hi Anan,
> when i run it, i find five connection with database by firewall
Normal you asked for a pool of 5 connections
> but only one connection working
Normal you're using only one connection
> it's spending too much time during "OCI_ConnPoolGetConnection(data)"
The first attempt to get a connection from the pool is expensive because 5 connections are physically created by OCI..
Further call to get a connection will return quicky becauseif you've got connection ready to be used in the pool.
That's the idea behing 'connection pooling'
Vincent.
Thank you for answer Vincent.
The problem i can not understood is after the pool created,I create (MAX_THREADS 50) work threads, they are blocked calling OCI_ConnPoolGetConnection API,and only one connection transfer data with database server. and max_conn not reached.
Just the sql querys on a established connetion can return quickly.
Hi,
What version of ocilb and oracle are you using ?
Have you passed the flag OCI_ENV_THREADED to OCI_Initialize() ?
Hi,
I've just compiled pool.c on :
with :
using 10.2.3 client and server and all tests ran fine...
That I think whether should remove the mutex from the OCI_ConnPoolGetConnection API.