案例如下:应用程序事务使用XA协议,程序操作是对某表插入记录,该表有一语句级的触发器,触发器中用了数据库连接(database link),操作失败.错误代码24777. 但在SQL/PLUS中对该表操作成功.查到24777指出在XA协议下使用DBLINK需要满足3个条件:1.  Use the Multi-Threaded Server configuration.2. Access to the other database must use SQL*Net Version 2 or Net8. 3. The other database being accessed should be another Oracle Server database数据库版本为8.17,可知道满足条件2,3,之后编辑init.ora文件加入MTS_DISPATCHERS="(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.8.187))(DISPATCHERS=4)"使满足条件一,这样即同时满足以上三个条件,重新运行程序.报错如下:154926.FANZZ!simpserv.1640.1036.0: gtrid x0 x373d1cae x3:  insert temp failure, sqlcode=-2068, sqlerr=ORA-02068: following severe error from ORA8I_DBLINK
ORA-03114: not conXA跟踪日志信息如下:154926.1640:1036.0:
OCITransDetach return code: -1154926.1640:1036.0:
ORA-24779: detach not allowed with open remote cursor参考资源如下:触发器代码:
-----------------create or replace trigger t_mytrigger
AFTER INSERT ON temp
DECLARE
data varchar2(32);
BEGIN
    select tname into data from tab@ora8i_dblink where rownum < 2;
    insert into temp2 values('1');
END;错误码信息解释:
---------------------1. ORA-24779 detach not allowed with open remote cursorCause: The migratable transaction tried to detach from the current session while an open remote cursor exists.Action: Close any open remote cursor prior to detach.2. ORA-02068 following severe error from stringstringCause: A severe error (disconnect, fatal Oracle error) was received from the indicated database link. See following error text.Action: Contact the remote system administrator.3. ORA-03114 not connected to ORACLECause: A call to Oracle was attempted when no connection was established. Usually this happens because a user-written program has not logged on. It may happen if communication trouble causes a disconnection. In addition, this message could occur when ALTER SYSTEM KILL SESSION or ALTER SYSTEM DISCONNECT SESSION were issued with the IMMEDIATE qualifier because, in those cases, the client's connection to the database is terminated without waiting for the client to issue a request.Action: Try again. If the message recurs and the program is user written, check the program. 4.  ORA-24777 use of non-migratable database link not allowedCause: The transaction, which needs to be migratable between sessions, tried to access a remote database from a non-multithreaded server process.Action: Perform the work in the local database or open a connection to the remote database from the client. If the multithreaded server option is installed, connect to the Oracle instance through the dispatcher.屏蔽触发器,直接在程序中引用数据库连接,错误信息同上.请教,如何才能在XA协议下正确使用DBLINK?