- Timestamp:
- Mar 12, 2013, 8:59:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/sh_database.c
r412 r427 539 539 char row_query[128]; 540 540 int retry = 0; 541 static SH_TIMEOUT sh_timer = { 0, 3600, S_TRUE }; 542 541 543 542 544 SL_ENTER(_("sh_database_query")); … … 636 638 (OraText*) db_password, sl_strlen(db_password), 637 639 (OraText*) db_name, sl_strlen(db_name))) 638 { 639 OCIErrorGet(o_error, 1, NULL, &o_errorcode, 640 o_errormsg, sizeof(o_errormsg), OCI_HTYPE_ERROR); 641 sh_stripnl (o_errormsg); 642 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 643 o_errormsg, 644 _("sh_database_query")); 645 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 646 _("check database is listed in tnsnames.ora"), 647 _("sh_database_query")); 648 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 649 _("check tnsnames.ora readable"), 650 _("sh_database_query")); 651 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 652 _("check database accessible with sqlplus"), 653 _("sh_database_query")); 654 sl_snprintf(row_query, 127, 655 _("OCILogon: Connection to database '%s' failed"), 656 db_name); 657 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 658 row_query, _("sh_database_query")); 659 bad_init = 1; 660 SL_RETURN(-1, _("sh_database_query")); 640 { 641 642 connected = 0; 643 644 sh_timer.flag_ok = S_FALSE; 645 646 if (S_TRUE == sh_util_timeout_check(&sh_timer)) 647 { 648 OCIErrorGet(o_error, 1, NULL, &o_errorcode, 649 o_errormsg, sizeof(o_errormsg), OCI_HTYPE_ERROR); 650 sh_stripnl (o_errormsg); 651 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 652 o_errormsg, 653 _("sh_database_query")); 654 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 655 _("check database is listed in tnsnames.ora"), 656 _("sh_database_query")); 657 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 658 _("check tnsnames.ora readable"), 659 _("sh_database_query")); 660 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 661 _("check database accessible with sqlplus"), 662 _("sh_database_query")); 663 sl_snprintf(row_query, 127, 664 _("OCILogon: Connection to database '%s' failed"), 665 db_name); 666 sh_error_handle((-1), FIL__, __LINE__, 0, MSG_E_SUBGEN, 667 row_query, _("sh_database_query")); 668 669 goto err_out; 670 } 671 else 672 { 673 SL_RETURN(0, _("sh_database_query")); 674 } 661 675 } 662 676 … … 848 862 * Error 849 863 */ 850 if (sh_persistent_dbconn == S_FALSE) 851 { 852 OCILogoff(o_servicecontext, o_error); 853 OCIHandleFree((dvoid *) o_statement, OCI_HTYPE_STMT); 854 OCIHandleFree((dvoid *) o_servicecontext, OCI_HTYPE_SVCCTX); 855 OCIHandleFree((dvoid *) o_error, OCI_HTYPE_ERROR); 856 o_error = NULL; 857 connected = 0; 858 } 864 sh_database_reset(); 865 859 866 SL_RETURN(-1, _("sh_database_query")); 860 867 }
Note:
See TracChangeset
for help on using the changeset viewer.