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: Resetting state of PL/SQL package

Re: Resetting state of PL/SQL package

From: Vladimir M. Zakharychev <bob_at_dpsp-yes.com>
Date: Tue, 21 Jan 2003 14:33:50 +0300
Message-ID: <b0jb71$lvr$1@babylon.agtel.net>


"Karsten Farrell" <kfarrell_at_belgariad.com> wrote in message news:DPZW9.42$Lo2.2_at_newssvr19.news.prodigy.com...
> Do you just want to allow any session to *set* a package variable and
> allow any session to *see* the current value of that variable? If so,
> can you provide procedures/functions in the package to:
>
> set_variable(new_value);
> cur_value := get_variable;
>
> Then grant execute on the package to the world.
>
> As long as you don't close the session that's running the package, other
> sessions can use the get/set routines.

Hmm... Don't think it works this way - every session gets its own instance of the package and they cannot interact directly. As fas as I know, pipes, alerts, permanent tables and message queues are the only means for interaction between different sessions. Of these, pipes and alerts are my favorites since recently. Pipes are transaction-independent and are pretty easy to use. Besides, they come standard with SE, while AQ is EE option if I'm not mistaken. With pipes, you send the data to the pipe and unload the data off the pipe when you want it, but they have a limitation of single reader vs multiple posters. Alerts are transaction-dependent (signaller has to commit for alert to be sent) and alert subscribers may be blocked if they use non-zero timeouts, but otherwise they are great for notifying interested sessions that something of interest changed. Both pipes and alerts can be used in triggers, difference is that a message will always get through the pipe whatever the tx outcome, while alert will only be signalled if signaller commits. In this particular case, alerts seem to be what OP is after. In a trigger on table of interest, you send signals, and all interested sessions are repeatedly checking for them with zero timeouts and, if received, refresh or reset their state. Pipes are more suitable for logging and auditing (and they can also be used for debugging, especially of remote stored procedures when both pipe writer and reader are executing on the remote end of a db link.)

--
Vladimir Zakharychev (bob@dpsp-yes.com)                http://www.dpsp-yes.com
Dynamic PSP(tm) - the first true RAD toolkit for Oracle-based internet applications.
All opinions are mine and do not necessarily go in line with those of my employer.
Received on Tue Jan 21 2003 - 05:33:50 CST

Original text of this message

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