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

Home -> Community -> Usenet -> c.d.o.server -> Oracle External Procedures (not a listener question)

Oracle External Procedures (not a listener question)

From: JSB <manoloveandwar_at_yahoo.com>
Date: Fri, 24 Dec 1999 18:23:41 -0500
Message-ID: <tgT84.18644$W2.143028@iad-read.news.verio.net>


Howdy,

It appears that extproc is mapping in my .so for each call, and unmapping it at the end of each, which means that my static storage gets reset each time, even for multiple calls in one pl/sql procedure. This is slightly vexing. Is this right, or do I have to do something more in the ld? Or, do I need to open up an shared memory segment to store some data behind oracle's back? I'm just caching some stuff, it does not need to be that robust, just moderately quick if I'm going to call it a couple of hundred times in one PL/SQL SP. To give you a clearer picture of what I mean, here's some pseudoC: In the shared library, we have:
static int number;
int GetNumber() {return(number++);}

From my testing program, if I

x=GetNumber();
y=GetNumber();
z=GetNumber();

I would get

x==0
y==1
z==2

Calling the same procedure from inside of a stored procedure

x:=GetNumber();
y:=GetNumber();
z:=GetNumber();

then

x==0
y==0
z==0

I suppose, in retrospect, it could be caching return values, but I think one of the myriad of tests I did ruled that out, and that would probably be stupid anyway.

Any suggestions, other than having to fight with IPC?

-J

If you don't mind, please post here so I don't get a dozen copies of the same answer to my mailbox from a dozen different people. Feel free to cc: me, tho, unless it becomes a discussion. Received on Fri Dec 24 1999 - 17:23:41 CST

Original text of this message

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