Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> OCI Oracle 8.1.7 How to emulate connection pooling?
Configuration: MS Win2k SP2, MS Visual C++ 6.0 SP6, Oracle 8.1.7 via OCI
I know that OCI in Oracle 9i supports Connection pooling.
I would like to know how to manage connection pooling on my own in Oracle 8.1.7, by using OCI functions.
If a connection is shared between multiple user sessions, which handles do I need separate for each user session, and which can be connection based?
For example:
Connection:
...open: initialize enviroment handle, alloc & attach server handle to
server
...close: dettach & free server handle, free env handle
User session:
...open: alloc service context & link it with server handle from opened Connection, alloc session handle & put sec.attributes in it & begin session ...close: close session & free session handle, free service context handle
I thought about putting user session & service context in the Connection as well but then again how to separate transactions from different user sessions?
However, there is a problem with my example:
- Close part of user session doesn't free any handles after close session -
OCIHandleFree returns -2 (invalid handle) and memory usage goes up and up -
until end of process. Is it a problem to free service context & session
handles before dettaching server handle? How to manage my connection pooling
in that case?
Any ideas on this subject?
-- -- /Tomislav.Received on Mon Feb 25 2002 - 09:49:16 CST