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: ProC and the UNIX fork!?!

Re: ProC and the UNIX fork!?!

From: Michael Krolewski <vandra_at_u.washington.edu>
Date: Sun, 17 Jan 1999 11:41:58 -0800
Message-ID: <36A23D05.CE366000@u.washington.edu>


You are working in a multi-threaded environment. Use the mutlithread support.
The Oracle manuals have excellent examples of mutlithread support in the OCI chapters.

You need to only log in once. The major issue will be to use critical sections to prevent more than one thread trying to use the same connection.

Alternatively, you can open a second (third, fourth, etc) connection, open a cursor, perform an operation, close the cursor and close the connection.

Also look at possible mistakes in your functions. I have seen a stored procedure that opens a cursor and never closes it. One could think that when the procedure ends, the cursor closes. Not so. You need to explicitly close the cursor. As a side note, the cursors are destroyed with the connection is closed.

Mike Krolewski

Alexandre Wagner Agostini wrote:

> Hi, guys!
>
> I've made a system like this: client-server, the client side just
> get two parameters and then
> send it, via ordinary TCP/IP connection to the server which has a
> permanent connection
> with an Oracle db. The server was written using ProC. The problem is
> that when the whole
> thing runs I get ,after a while (a few minutes), the error "maximum
> number of open cursors
> exceeded" e then the connection with Oracle falls.
> I suspect this is due to the fact that I open the db connection once,
> then to each new
> TCP connection I fork off a child to handle the operation with the db.
> After the operation is
> done (it's just a single UPDATE statement) the child simply exits.
> SO... the 1 million dollar question: how can I make the connetion in
> one process, do
> the statement in other, and get whole thing stable and working??
>
> PS.: The specs: Solaris 2.5.1, Oracle 7.3.2.
>
> Any ideas?
>
> Thanks in advance.
>
> Alex.
Received on Sun Jan 17 1999 - 13:41:58 CST

Original text of this message

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