Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to use OCI/ODBC in multi-process programs?

Re: How to use OCI/ODBC in multi-process programs?

From: Sree <replyto.newsgrp_at_nowhere.com>
Date: Mon, 20 Sep 2004 14:36:59 +0530
Message-ID: <414E9DB3.6060401@nowhere.com>


Jason Liang wrote:

> I can't use thread, because I have to use another library that is not
> thread-safe.
>
> I know if I open a file before forking a process, then the child
> process will inherate the open file descriptor. I am not sure if a
> child process inherate an open database connection - using OCI or
> ODBC.
>

Right now there is no way through OCI to share a connection among processes. Fork replicates file descriptors and also the OCI handles, but you can get undefined results if you try to use the replicated OCI handles in both the parent and child(you should be able to use just one of them though!).
Connection pool would be a good entry point to implementing the required feature. However, currently, the connection pool is single-process. If Oracle makes it shareable across processes, not necessarily just parent-child, that'l be a solution to you among others. You can try to file a request for this feature with Oracle!

Thanks,
Sree Received on Mon Sep 20 2004 - 04:06:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US