Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Oracle 10g claiming that a package body has errors when it does not

I have a few packages on my oracle instance. When I recreate my database from scratch, I get zero invalid objects, and no warnings from liquibase.

Then, when I call a package method, like so:

new SimpleJdbcCall(jdbcTemplate).withCatalogName(packageName).withProcedureName(storedProcedureName).execute(parameterMap);

It gives me the following error:

org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call CALENDAR_MANAGEMENT.CREATE_SUMMARIES(?, ?, ?, ?, ?, ?, ?, ?, ?, ?)}]; SQL state [72000]; error code [4063]; ORA-04063: package body "ETPDEV.CALENDAR_MANAGEMENT" has errors
ORA-06508: PL/SQL: could not find program unit being called: "ETPDEV.CALENDAR_MANAGEMENT"
ORA-06512: at line 1; 

nested exception is java.sql.SQLException: ORA-04063: package body "ETPDEV.CALENDAR_MANAGEMENT" has errors
ORA-06508: PL/SQL: could not find program unit being called: "ETPDEV.CALENDAR_MANAGEMENT"
ORA-06512: at line 1

Caused by: java.sql.SQLException: ORA-04063: package body "ETPDEV.CALENDAR_MANAGEMENT" has errors
ORA-06508: PL/SQL: could not find program unit being called: "ETPDEV.CALENDAR_MANAGEMENT"
ORA-06512: at line 1

Checking for invalid objects again turns up nothing. Compiling CALENDAR_MANAGEMENT again completes normally without errors.

I've tried a full schema recompile, but that did not work.

When I call it from SQLDeveloper, it works normally.

like image 352
Jon Bristow Avatar asked Apr 19 '12 18:04

Jon Bristow


1 Answers

I was running into this error in my integration checks, and I didn't think to check the validity of the package WHILE it was running.

Dropping a simple bit of code right before the call for the package:

select name || ' - ' || line || ' - ' || text from user_errors order by name, sequence;

I found that a different test was not cleaning up after itself, but this one was, so when I looked at the DB before and after, it looked fine.

like image 170
Jon Bristow Avatar answered Oct 21 '22 05:10

Jon Bristow