Home » SQL & PL/SQL » SQL & PL/SQL » Existing state of packages has been discarded...?
Existing state of packages has been discarded...? [message #226458] Fri, 23 March 2007 17:14 Go to next message
henckel
Messages: 9
Registered: March 2006
Junior Member
We're experiencing a strange problem with PL/SQL package compilation and the execution of a certain procedure of this package.

Software environment:
  • Oracle 9i
  • BEA WebLogic 8.1 SP5
  • Java web front-end
  • database handling with EJB 2.1

Action to cause the error:
  1. Compile a certain package -> without any errors/warning
  2. Execute the functionality using the web front-end -> error (does not work)
  3. Execute the functionality using the web front-end (again) -> works fine

The error we get when executing the functionality the first time is:
ORA-04068: existing state of packages has been discarded

We believe that this might have something to do with the connection between the WebLogic application server and the database. Restarting the WebLogic after having compiled successfully will probably solve the problem, but this is not really satisfying.

Is there any other way to get rid of this error? Maybe any chance to refresh the connection automatically?

Thanks a lot for your help!

Best regards
Sven

[Updated on: Fri, 23 March 2007 17:17]

Report message to a moderator

Re: Existing state of packages has been discarded...? [message #226460 is a reply to message #226458] Fri, 23 March 2007 17:39 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
ALTER SESSION SET REMOTE_DEPENDENCIES_MODE=SIGNATURE
might help, then again it might not
Re: Existing state of packages has been discarded...? [message #226467 is a reply to message #226460] Fri, 23 March 2007 21:28 Go to previous messageGo to next message
rleishman
Messages: 3724
Registered: October 2005
Location: Melbourne, Australia
Senior Member
As I think you have discovered, the session that experiences the error has already executed part of that package and has a local copy in memory.

After recompiling in another session, when you go to execute again, it tries its local copy but discovers that its out of date and throws the error.

I've never found anything that helps, but I haven't tried anacedent's suggestion. Looking at the doco, I think that trick might only avoid the invalidation of dependent procs if you recompile without changing the name, parameters, or function return types.

It's never really bothered me before because we always have outages to implement new code.


Ross Leishman

Re: Existing state of packages has been discarded...? [message #226468 is a reply to message #226458] Fri, 23 March 2007 21:38 Go to previous messageGo to next message
BlackSwan
Messages: 25036
Registered: January 2009
Location: SoCal
Senior Member
With REMOTE_DEPENDENCIES_MODE=SIGNATURE as long as the package header does not change a recompile is not forced.
IIRC, if Session#1 is executing a package, then Session #2 will "hang" (wait quietly) until Session #1 completes its run before the package can be (re)compiled.
This hang can tested/validated by simple procedure invoking DBMS_LOCK.SLEEP() with a sufficient duration.
Re: Existing state of packages has been discarded...? [message #226524 is a reply to message #226468] Sat, 24 March 2007 10:35 Go to previous messageGo to next message
S.Rajaram
Messages: 1027
Registered: October 2006
Location: United Kingdom
Senior Member
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:286816015990. Check it out. It talks in detail exactly what you are after.
Re: Existing state of packages has been discarded...? [message #226525 is a reply to message #226458] Sat, 24 March 2007 10:57 Go to previous message
henckel
Messages: 9
Registered: March 2006
Junior Member
Thanks a lot your answers!
Especially the last link is helpful.
Previous Topic: how to give foreign key references from one user table to another user table
Next Topic: Number of Bind variables passed AND Ref Cursor problem
Goto Forum:
  


Current Time: Sun Dec 04 10:28:21 CST 2016

Total time taken to generate the page: 0.17613 seconds