我正在使用 JDBC 调用存储过程,并且连接配置为UCP
在 Oracle Web Logic Server 12c 中。下面是我的示例代码片段。
String query = "{? = call PACK_GLOBAL_VARIABLES.getBatchDate()};
CallableStatement cs = connection.prepareCall(query);
cs.registerOutParameter(1, Types.DATE);
cs.executeUpdate();
问题是,每当 PL/SQL 端有任何代码更改时,我总是会收到此异常:
java.sql.SQLException: ORA-04068: existing state of packages has been discarded
ORA-04061: existing state of package body "SJN_UAT.PACK_GLOBAL_VARIABLES" has been invalidated
ORA-04065: not executed, altered or dropped package body "SJN_UAT.PACK_GLOBAL_VARIABLES"
ORA-06508: PL/SQL: could not find program unit being called: "SJN_UAT.PACK_GLOBAL_VARIABLES"
ORA-06512: at line 1
此问题可通过以下两种方式之一解决:
- 重新启动 Web 逻辑服务器
- 多次编译PL/SQL包(无需重启Web Logic)
以上两种方法在生产环境中都不可行。任何人都可以帮助确定这个问题和可能的解决方案吗?