4 Replies Latest reply: Jan 12, 2011 6:44 AM by Billy~Verreynne RSS


      Hi all,

      as I was looking through the new features guide of 11.2 release I ran across
      the following section which raised my interest:

      --- Improvements to Reduce the Occurrences of "Existing State of Packages
      Discarded" Errors

      When the body of a stateful package is recompiled by session A, then a
      different session B which has already instantiated that package will
      experience the ORA-04068 existing state of packages… has been discarded family
      of errors on its next reference to that package following the recompilation.
      The result is severe disruption for the user of session B.

      Two improvements in this release now reduce the likelihood of these ORA-04068

      * A package, whose global variables is marked constant; and where the
      initial value can be computed at compile time, is now considered to be
      * The new procedure DBMS_SESSION.RESET_SELF(), whose invocation must
      be in the package of interest, allows you to preempt the problem when it is
      safe to reinitialize the package state.

      The advantage is that packages (and especially those that are not editioned)
      can be "hot patched" (that is, recompiled) when other sessions are using them
      with a greatly reduced likelihood of disrupting those sessions.


      As I wanted to try out the DBMS_SESSION.RESET_SELF() procedure I did not find
      it in the dbms_session package ? There is also no documentation in the Types
      and Packages book. Any hints ? Do I miss something ?

      Very best regards