I made sample applications (server and client) by ‘MultiDB Login Server’ wizard (Data abstract trial 6.0.61.1029) in Delphi 7. Server application should connect database in ‘SQL Server’ with UniDAC driver (version 4.3.8 - newest version). These applications was upgrade to Delphi XE2. Before I upgrade applications to Delphi XE2 I put uDAUniDACDriver.pas unit in uses clause of fServerDatModule (this unit contain ConnectionManager and DriverManager).
I want to check username and password from ‘SQL Server’.
Unit LoginService_Impl.pas contain event OnLogin:
procedure TLoginService.LoginServiceLogin(Sender: TObject; aUserID,
aPassword: Utf8String; aConnectionName: Utf8String; out aUserInfo: UserInfo;
var aLoginSuccessful: Boolean);
var
aIDAConnection : IDAConnection;
begin
aIDAConnection := Self.ConnectionManager.NewConnection(aConnectionName, True, aUserID, aPassword);
aLoginSuccessful := aIDAConnection.Connected;
if aLoginSuccessful then begin
aUserInfo := UserInfo.Create;
aUserInfo.SessionID := UTF8String(GuidToAnsiString(ClientID));
aUserInfo.UserID := aUserID;
Session['UserID'] := aUserID;
// store connection name for use in data service
Session['ConnectionName'] := aConnectionName;
end
else begin
DestroySession;
end;
end;
Connection aConnectionName (has valid ConnectionString) is in the Self.ConnectionManager (Self.ConnectionManager = ServerDataModule.ConnectionManager).
I try to check username and password: aUserID = ‘10’ and aPassword = ‘20’ (wrong UserID and Password) for the database in the connection string, but aIDAConnection.Connected return True.
When NewConnection is executed with aConnectionName (aConnectionName is in ConnectionManager pool) event ‘OnConnectionCreated’ is fired?
ConnectionManager properties:
MaxPoolSize = 10
PoolBehaviour = pbWait
PoolingEnabled = True
PoolTimeoutSeconds = 60
PoolTransactionBehaviour = ptNone
WaitIntervalSeconds = 1
ConnectionManager contain one connection.
Maybe I doing something wrong.
Best Regards,
Goran