Forum OpenACS Development: change in a package takes time to take effect?

I tried to change some code in a package in acs-notifications. I redefined the package body and re-ran it thru sqlplus. But it seems to not be working.

  • Do I need to wait some time for the new one to take effect?
  • Do I need to restart Oracle for the new one to take effect?

I am running Ora8.1.6 on RH6.2 with ACS4Tcl.

TIA.

Regards..

Collapse
Posted by Vinod Kurup on
Do I need to wait some time for the new one to take effect?
Do I need to restart Oracle for the new one to take effect?

I believe changes that you make to an oracle package in sql-plus take place immediately (once you type 'commit;'). You don't need to restart Oracle.

What changes did you make?

I made this change in a package (i.e. PL/SQL). I was changing so many modules yesterday, that I have forgotten which one this change was done to. But, I could not find a commit-type statement in PL/SQL. The only message I saw was "Package created".

I waited a while, made some other chages to some .tcl and it was still busted.

So this morning, I bounced Oracle, and the changes seemed to go thru. I will need to look into this further.

- Does the engine cache compiled packages?

- If so, what is the procedure to make new packages become "live"?

In the meantime, I will document the original problem I was trying to solve (wrt bboard subscription notifications).

Regards..Roger

All Oracle PL/SQL code - packages, functions, procedures, triggers,
whatever - takes effect immediatly when you do issue the "create or
replace" statement in sqlplus.  There is no two-pase commit like there
is for normal DML statments.

I'm not entirely sure what you mean by "Does the engine cache compiled
packages?" (what engine?), but I'm pretty sure the answer is "no".

When you load in some PL/SQL code, Oracle compiles it immediately and
saves both the original code and a compiled version.  You can also
recompile code in place, for example if the compile failed due to a
dependency problem, or if the code ever becomes invalid due to a
dependency problem.

So you had some other problem.  When you replace pl/sql code in
Oracle, there is no delay - and as far as I know there CANNOT be any
delay.  It takes effect immediately.

Collapse
Posted by Don Baccus on
Check to make sure that the Tck client code isn't caching the query calling the function or procedure ...
How can I tell if the query is being cached? I know that some procs are sourced at AOLServer startup, but I have not made (or seen) a list. Are there other cases where queries will be cached?

TIA.

Regards..

Collapse
Posted by Don Baccus on
look for memoize calls ... these are caching the proc call passed in as an arg, and typically the proc call is a wrapper around an SQL query.
Collapse
Posted by Tom Jackson on

I have installed OpenACS4-core plus the package I am porting. Whenenver I make a change to the sql in a .xql file, I have to restart AOLserver for the change to take effect. This is my package, so I know there are no memoize procs in my code. Is there a configuration switch to force re-reading of the .xql file on each request?

Collapse
Posted by Don Baccus on
Check out the "watch" facility in the APM ... I've not tested my changes to make it work with .xql files thoroughly, let me know if it doesn't seem to be working for you. aD implemented this for Tcl library files, I just extended it as described below:
I recently modified the APM to implement the "watch" feature for .xql files. The functionality is equivalent to the already existing functionality for Tcl library files.

When you modify a query file or Tcl library file and visit the APM's index page, the package will be marked with a "reload" hyperlink. Punch it and all modified Tcl library and query files will be reloaded. They'll be listed with a "watch" hyperlink, punch that and the system will monitor the file(s) and reload them automatically every time they change, very convenient for development. You should never need to reboot AOLserver in order to accomodate such changes if you use this feature of the APM.

You can't turn off "watching" once you've turned it on, other than by rebooting AOLserver. That's no big deal since you'll be enabling this on your local development servers.

Thanks Don, it works great! The .xql file is re-read on each access after I stated 'watch'ing it. Life is easy now.

Collapse
Posted by Stephen . on
I like this feature, but I find it a pain to have to watch each file individualy. When you restart the server, it forgets and you have to watch them all again. Wouldn't it be a lot easier to use and loose nothing if there was just one big DevelopmentP parameter which turned on file watching globaly, as well as developer suppport etc.?
Collapse
Posted by Don Baccus on
I have a long list of APM improvements that would make life easier :)
Collapse
Posted by Don Baccus on
Stephen - why not add that as a feature request in the SDM?