Oracle:加载java类时如何避免“java会话状态清除”错误?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2324984/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 20:03:26  来源:igfitidea点击:

Oracle: how to avoid "java session state cleared" error when loading a java class?

javaoraclestored-procedures

提问by Mark Harrison

Whenever I load a java class, I will get this error on my open sessions when I call a member of the class. Is it possible to avoid this?

每当我加载 Java 类时,当我调用类的成员时,我都会在打开的会话中收到此错误。有没有可能避免这种情况?

ORA-29549: class MH.Tbs has changed, Java session state cleared
ORA-06512: at "MH.TBS", line 2
ORA-06512: at line 4
29549. 00000 -  "class %s.%s has changed, Java session state cleared"
*Cause:    A class in use by the current session was redefined or dropped,
           invalidating the current Java session state and requiring that
           it be cleared.
*Action:   No action required.

回答by gokhant

You can not avoid this, but there are workarounds.

您无法避免这种情况,但有一些解决方法。

When you change (loadjava, dropjava etc for example) the classes used by java stored procedures, this happens. Recalling might work; ending your session, creating a new one and recalling will definitely work. This is like the pl/sql packages getting invalidated when related(dependent) objects are modified.

当您更改(例如 loadjava、dropjava 等)java 存储过程使用的类时,就会发生这种情况。回忆可能有效;结束您的会话,创建一个新会话并进行回忆肯定会奏效。这就像修改相关(依赖)对象时 pl/sql 包变得无效。

by the way, you might like to check this also: http://forums.oracle.com/forums/thread.jspa?threadID=856644

顺便说一句,您可能还想检查一下:http: //forums.oracle.com/forums/thread.jspa?threadID=856644

回答by Chantal

It happened to me when I used a java class being called by a function pl / sql oracle . I discovered that the cause was the System.println that existed in the java class. I removed them and it worked.**

当我使用一个被函数 pl/sql oracle 调用的 java 类时,它发生在我身上。我发现原因是java类中存在的System.println。我删除了它们并且它起作用了。**