我正在使用jboss5.1.x,ejb3.0,jpa3。

我正在尝试从通过 dblink 连接到另一个数据库的视图中'选择'查询。

源数据库 oracle 9 ,目标dabatase是 oracle 8

我收到这个错误:

15:27:06,625 WARN [JDBCExceptionReporter] SQL Error: 24777, SQLState: 99999

15:27:06,625 ERROR [JDBCExceptionReporter] ORA-24777: use of non-migratable database link not allowed
.

我发现解决问题后我明白我无法使用 dblink ,同时使用 xa 。因此,我设法通过将dblink脚本更改为创建共享数据库链接,如下所示:

 CREATE SHARED DATABASE LINK CONNECT TO IDENTIFIED BY AUTHENTICATED BY IDENTIFIED BY USING 
.

在此测试环境中一切都在很好。 现在我现在将我的应用程序移动到生产环境,其中源数据库是 oracle 11 ,而目的地仍然 oracle 8

我使用的诀窍没有工作,我无法找到解决方案。这是我获得的新例外:

    Caused by: org.hibernate.exception.GenericJDBCException: could not execute query
    at ....Caused by: java.sql.SQLException: ORA-01012: not logged on
    ORA-02063: preceding line from TO_VANTIVE
.

感谢您的帮助,

ray,

有帮助吗?

解决方案

ORA-01012: not logged on

seems to suggest that you haven't configured the new link correctly and since the database is now 11g which may have case sensitive passwords that would be the first thing to check.

Put quotes around the password in the CREATE LINK if the remote schema(s) have case sensitive passwords. Thus

CREATE SHARED DATABASE LINK
CONNECT TO bob IDENTIFIED  BY "MyNewPasswd1"
AUTHENTICATED BY jim IDENTIFIED BY "JimsPass23" USING 'DB01';

其他提示

We have the same problem with Weblogic, and the solution is to utilize the non XA oracle JDBC driver.

I was experiencing the same problem here with a Oracle 11g (ORA-24777). I've performed a join between a single table (in my schema) and a view (created by a database link). I've executed the all over a JBoss datasource in XA mode.

In order to get it to work well, I had to change the mode of my dblink view. In this case, is very important to have a precise AUTHENTICATED BY clause to avoid getting "ORA-01012: not logged" on.

Please make sure the DB link you are using is Public and Shared, if the DB link is not Public and Shared it will throw an Exception ORA-24777: use of non-migratable database link not allowed. But if you try to run the same query directly on DB with out using any Java or XA transaction it will work fine.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top