我有以下功能,当前端(ADF)调用此函数进行计数时,我经常遇到以下错误。 不同的错误来自不同的时间。
我认为有时听众会失败所以可能会发生但其他错误?当前端用户点击链接并且该链接依次调用此数据库功能时会发生这种情况。
我无法在功能中找到问题: - (
1) error "-12170 : ORA-12170: TNS:Connect timeout occurred"
2) error "-12571 : ORA-12571: TNS:packet writer failure"
3) error "-12541 : ORA-12541: TNS:no listener
4) error "-12514 : ORA-12514: TNS:listener does not currently know of service requested in connect descriptor
5) error "-3113 : ORA-03113: end-of-file on communication channel
ORA-02063: preceding line from DBLINK"
6) error "-2051 : ORA-02051: another session or branch in same transaction failed or finalized
ORA-02063: preceding line from DBLINK"
FUNCTION GET_A (p_in IN VARCHAR2) RETURN NUMBER
AS
PRAGMA AUTONOMOUS_TRANSACTION;
PRE_COUNT NUMBER := NULL;
BEGIN
SELECT GET_B@DBLINK (p_in,NULL)INTO PRE_COUNT FROM dual;
COMMIT;
-- dbms_lock.sleep(2);
DBMS_SESSION.CLOSE_DATABASE_LINK('DBLINK');
COMMIT;
RETURN PRE_COUNT;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
LOG_ERR ( p_cd => SQLCODE,p_msg => SQLERRM);
RETURN -1;
END GET_A;