ORA-04068: existing state of packages has been discarded
OracleWhat does it mean?
While a running session was using a package's state, the package was recompiled, so that state was invalidated. The package instance held by the session is no longer valid.
Why does it happen?
A package body or specification was recompiled with ALTER/CREATE OR REPLACE while sessions depending on it were active; it usually occurs during application deployment on a live system. Seen together with ORA-04061/04065.
How to fix it
Re-running the call (retry) usually resolves it; on the second attempt the package loads in its new form. Catch ORA-04068 in the application and retry automatically. Apply package changes in maintenance windows when user activity is low. A stateless package design reduces this problem.
More from this engine
- ORA-00979not a GROUP BY expression
- ORA-00918column ambiguously defined
- ORA-06550line/column PLS-... PL/SQL compilation error
- ORA-01427single-row subquery returns more than one row
- ORA-12899value too large for column
- ORA-30926unable to get a stable set of rows in the source tables
- ORA-08103object no longer exists