oracle存储过程包损坏,关于存储过程包失效的问题!急!

包没问题啊,我看有人是这样解释的,但是还是解决不了问题啊,杀session也会影响其他业务啊,而且我试了好像没效果,不知道是不是没杀正确

一、

1.   楼主新打开一个session去执行就没有该问题了

2.   因为在A会话修改包并重复编译的时候之前,B会话已经执行过一次A会话的包中的函数,而A会话修改和编译完毕后,B会话再次调用A会话中的包中的函数,oracle发现缓存区中的包的函数已经是旧的了,所以返回提示信息:

ORA-04068:   已丢弃程序包     的当前状态

ORA-04061:   package   body   "DB2INST2.PKGTEST "   的当前状态失效

ORA-04065:   未执行,   已更改或删除   package   body   "DB2INST2.PKGTEST "   --   注意“已更改”

然后删除了缓存中的包pkgtest的函数

再次执行的时候,重新读取函数,就不会存在该问题

如果重新打开一个session的去执行的话,也不会存在该问题

二、

This message was send by oracle via the jdbc driver, not weblogic. Weblogic just reutter the error message to you.The same situation exists in prepare statement. i.e, in your app, first you prepare a statement that select a table's content, it will succeed without error, then you drop the table manually, last you call the prepared statement again, you certainly will get the same error.I think the error lies in that, no matter package,procedure,prepare statement, Oracle parse them and store the parsed version in some Cache memory, and when the cached version was nolonger valid, then oracle throws an error to you.But if you reconnect to database, the cache (your own session cache now empty) will get recached by valid content, then oracle will not throw the same error, in the former example, it will throw an error state that the table was not exist.So, an ugly solution will be cheat weblogic by manully drop all user session made by weblogic in oracle's management console or in sqlplus. But this will cause your app throw errors also. But catch sql exception was commont part of all jdbc application, so, it will be properly handled or probably proper handled.And last, if you recompile your procedure, you are on a development server, isn't it? So, it does not matter what ever you will restart...

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值