‎2011 Nov 14 9:02 AM
Dear all,
I have a test program in production to connect to the DBCO. It connects successfully but failed occasionally. Mean, every few minutes, the connection will become fail! Anyone of u have idea why this happened and how to resolve this? Thank you very much.
I have been tested my test program and the standard ADBC_TEST_CONNECTION at the same time. Sometimes, both are success. Sometimes, when the latter showed success connection, the former will be failed.
Thanks.
‎2011 Nov 14 7:10 PM
Catch the CX_SY_NATIVE_SQL_ERROR exception to get to know the error message. If you are already doing so, provide the error messages ( short and long messages ) when it fails.
Data: DB_EXCEP TYPE REF TO CX_SY_NATIVE_SQL_ERROR.
*-Connect Native DB
CLEAR: DB_CON_STATUS.
TRY.
EXEC SQL.
connect to :db_name as :sy-uname
ENDEXEC.
IF sy-subrc EQ 0.
db_con_status = 'X'.
ENDIF.
CATCH cx_sy_native_sql_error INTO db_excep.
clear e_dbmsg.
CALL METHOD db_excep->if_message~get_text
RECEIVING
result = e_dbmsg.
CLEAR: e_dbmsg_long.
CALL METHOD db_excep->if_message~get_longtext
RECEIVING
result = e_dbmsg_long.
CLEANUP.
Clear: db_name, e_dbname.
ENDTRY.
Edited by: Suman Jagu on Nov 14, 2011 2:10 PM
‎2011 Nov 15 5:37 AM