In my appliction when database alias is wrong i need catch this error
(for example in tnsnames.ora I create some alias testdb of database for
tnsping testdb return TNS-12543 TNS:destination host unreachable)
I do this code in my program:
try
//ReturnCode := FSourceOracleQuery.Session.ReturnCode; //It's OK!!!
if not FSourceOracleQuery.Session.Connected
and
(FSourceOracleQuery.Session.CheckConnection(True) = ccError)
then raise EOracleError.Create(FSourceOracleQuery.Session,
FSourceOracleQuery.Session.ReturnCode,
FSourceOracleQuery);
except
on E: EOracleError do
begin
if E.ErrorCode = 12543
then begin
WriteToLog(E.Message, mtError);
raise;
end;
end;
end;
But, in EOracleError.Create constructor on line:
{Error = 12543}
OCIErrorGet(OCIError(Error), 1, nil, ub4(Error), Msg, SizeOf(Msg), OCI_HTYPE_ERROR);
raised Access violation at address 60601FC5 in module 'OraClient9.Dll'. Read of address 000030FF
and except ... end block not executed.
Why raise Access Violation?
Perhaps TNS-12543 is TNS error and not OCI and in OraClient9.Dll not entry for error OCIError(Error), where Error = 12543.
Who help me please?
Or who tell me another way for raise EOracleError.Create?
(for example in tnsnames.ora I create some alias testdb of database for
tnsping testdb return TNS-12543 TNS:destination host unreachable)
I do this code in my program:
try
//ReturnCode := FSourceOracleQuery.Session.ReturnCode; //It's OK!!!
if not FSourceOracleQuery.Session.Connected
and
(FSourceOracleQuery.Session.CheckConnection(True) = ccError)
then raise EOracleError.Create(FSourceOracleQuery.Session,
FSourceOracleQuery.Session.ReturnCode,
FSourceOracleQuery);
except
on E: EOracleError do
begin
if E.ErrorCode = 12543
then begin
WriteToLog(E.Message, mtError);
raise;
end;
end;
end;
But, in EOracleError.Create constructor on line:
{Error = 12543}
OCIErrorGet(OCIError(Error), 1, nil, ub4(Error), Msg, SizeOf(Msg), OCI_HTYPE_ERROR);
raised Access violation at address 60601FC5 in module 'OraClient9.Dll'. Read of address 000030FF
and except ... end block not executed.
Why raise Access Violation?
Perhaps TNS-12543 is TNS error and not OCI and in OraClient9.Dll not entry for error OCIError(Error), where Error = 12543.
Who help me please?
Or who tell me another way for raise EOracleError.Create?