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 -> Re: package variables

Re: package variables

From: Karsten Farrell <kfarrell_at_belgariad.com>
Date: Tue, 13 May 2003 15:49:28 GMT
Message-ID: <MPG.192ab3e6a8fcc1db98977c@news.la.sbcglobal.net>


rich.bevan_at_bt.com said...
> While calling a procedure (which uses htp package) from a web browser, I
> observed that each procedure call creates a new session. As a result, the
> package variables, set by a procedure is not accessible to another procedure
> of the same package.
>
> Is there any configuration setting on oracle http server which will force
> maintenance of a single session for all request coming from same ip address
> ? or is there any other way in which we can instruct the server to maintain
> session ?
>
> This is on Solaris 2.6 using the http server shipped with Oracle 8.1.7
>
> Thanks,
>
> Rich
>

I don't know whether this is the "best" solution (sometimes deadlines don't give us the time to research "better" ways of doing it). This idea might suggest another even better soluton. What you want to do is to make the package persistent across sessions.

Let's say SCOTT owns the package and has granted EXECUTE to all the appropriate users who want to reference the package. Now write a shell script that references the package (say it sets a global variable or some such) and then hibernates or waits for an event that never gets activated (to keep the session persistent). Now run the script as a background process (so you don't tie up a terminal session). Other users then call some function or procedure in SCOTT's package.

SCOTT's package will remain in memory until you reboot the server, at which time you have to remember to restart it.

By the way, instead of everyone and their brother being able to get/set the global package variables, it's a good idea to code pairs of get/set routines in the package so other apps don't have to have knowledge of the package's internals.

I used this technique a long time ago with Oracle7. There just might be a better way in 8i or 9i.

-- 
/Karsten
DBA > retired > DBA
Received on Tue May 13 2003 - 10:49:28 CDT

Original text of this message

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