TOraSession.ChangePassword doesn't work (5.55.1.24)
Posted: Mon 19 Dec 2005 13:30
Doesn't work if session is not connected.
However, this should be easy to fix:
//----------------------------------------------------------------------------
//2005-12-19 14:05 N,??:
//2005-12-19 14:05 B,SM B3587: try/finally used (to return connection)
// using SetUserName/SetPassword if not connected
procedure TOraSession.ChangePassword(NewPassword: string);
begin
CreateIConnection;
try //B3587
//B3587 begin
if not Connected then
begin
FIConnection.SetUsername(Username);
FIConnection.SetPassword(Password);
end;
//B3587 end
FIConnection.ChangePassword(NewPassword);
FPassword := NewPassword;
FIConnection.SetPassword(PChar(FPassword));
finally //B3587
if not Connected and (FIConnection.Pool nil) then begin
ConnectionPoolManager.ReturnConnection(FIConnection);
SetIConnection(nil);
end;
end;
end;
Regards
Stefan Meisner
However, this should be easy to fix:
//----------------------------------------------------------------------------
//2005-12-19 14:05 N,??:
//2005-12-19 14:05 B,SM B3587: try/finally used (to return connection)
// using SetUserName/SetPassword if not connected
procedure TOraSession.ChangePassword(NewPassword: string);
begin
CreateIConnection;
try //B3587
//B3587 begin
if not Connected then
begin
FIConnection.SetUsername(Username);
FIConnection.SetPassword(Password);
end;
//B3587 end
FIConnection.ChangePassword(NewPassword);
FPassword := NewPassword;
FIConnection.SetPassword(PChar(FPassword));
finally //B3587
if not Connected and (FIConnection.Pool nil) then begin
ConnectionPoolManager.ReturnConnection(FIConnection);
SetIConnection(nil);
end;
end;
end;
Regards
Stefan Meisner