Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6757373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:38:37+00:00 2026-05-26T13:38:37+00:00

I have an Oracle 10G installation (Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 –

  • 0

I have an Oracle 10G installation (Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 – Prod), and a java web app that calls stored procedures and functions in oracle via a JDBC connection. The SP’s and functions are part of a package. The first time a SP or a function is called, after the package is successfully compiled, I get these errors:

(I replaced our schema name and package name with “#schema-name#.#package-name#”)

ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "#schema-name#.#package-name#" has been invalidated
ORA-04065: not executed, altered or dropped package body "#schema-name#.#package-name#"
ORA-06508: PL/SQL: could not find program unit being called: "#schema-name#.#package-name#"
ORA-06512: at "#schema-name#.#package-name#", line 5393
ORA-06512: at line 1

The very next time it is called, everything runs the way that it should. Any ideas on why and how to keep this from happening?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:38:37+00:00Added an answer on May 26, 2026 at 1:38 pm

    This is normal behavior for packages that have state, i.e. they have body variables. When the package is compiled, the existing state has to be discared and all session that have used the package before receive the ORA-04068 error (except the one that compiled the package).

    As you have a web application, I assume it uses a connection pool that keeps the session alive. So they will all be affected if they have used the package before.

    One workaround is to call DBMS_SESSION.RESET_PACKAGE, which discards the state of all packages of the current session. Another one is to check whether you can get rid of the session state, which is somewhat problematic in combination with a connection pool.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an oracle 10g database that has 2 tables: a REBATES table, and
I have installed Oracle 10g Express Edition database on a server and install the
I'm a SQL Server DBA, but we have an Oracle 10g database that I
I have an Oracle 10g database of genomic data with several >100 million row
I have an INSERT query in Oracle 10g that is getting stuck on a
I have a PL/SQL package in an Oracle 10g database and I want to
I have created a table on an Oracle 10g database with this structure :
We have an Oracle 10g database (a huge one) in our company, and I
I have an Oracle 10g table that contains a # of log records. This
I have a spring/jdbc/oracle 10g application. The Oracle server database timezone is set to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.