Server exception Session {GUID-xxxx-xxx...} could not be found

I created a brand new DA Custom Server in delphi and DA custom client in Delphi, and the server appears to work, at least it worked well enough for the everwood client-generator GUI to run, connect to it, read its metadata and build things. Now I’m trying to get designtime connectivity of the client to the server. Designtime connectivity means making my TDAMemDataTable objects Active at designtime. That’s my real problem. How do I do it?

I have tried setting the ClientChannel object to Connected. The Login (TROLogin) property of the ClientChannel appears to be set properly (I don’t have any logic in the server requiring a valid user name and password anyways).

Where I’m stuck is when I try to set my tbl_tablename objects (TDAMemTable) to Active. I get this exception:

Session {D593AF96-0CDB-408A-9895-54F09508419A} could not be found

@Warren hi! I think that in the login service your session guid is not registred! but if you want to test it without a session you have a property (Require connection) on the dataservice located to the server. If you uncheck it your table should open. Excuse me if I am wrong (I am still a beginner with DataAbstract, but I want to help you because you also helped me with some questions on stackoverflow);

That could be exactly the problem.

Here is what I have on my login service implementation on the server; ValidateLogin is a service method on your login schema which queries the db for a user and the result is returned as a dataset;

procedure TLoginService.LoginServiceLogin(Sender: TObject; aUserID,
aPassword: Utf8String; out aUserInfo: UserInfo; var aLoginSuccessful: Boolean);
var
iduser,idgroup,numereal :string;
cmd : IDADataset;
begin
cmd := Schema.NewDataset(Schema.ConnectionManager.NewConnection(Schema.ConnectionManager.GetDefaultConnectionName), ‘ValidateLogin’, [‘UserId’, ‘Pass’], [aUserID, aPassword]);
cmd.Open;
if not cmd.eof then begin
aLoginSuccessful := true;
end;
if aLoginSuccessful then begin
aUserInfo := UserInfo.Create;
aUserInfo.SessionID := UTF8String(GuidToAnsiString(ClientID));
aUserInfo.UserID := aUserID;
Session[‘UserID’] := aUserID;
end
else begin
DestroySession;
end;
end;

I tried to do that, but got stuck again, because “Schema.ConnectionManager” is nil on me when I try this.

Somehow when setting up my schema object, I forgot to properly set its ConnectionManager property in my new login service. Oops. Now it all works!

Hello,
Please look at ‘Design Time Login’ article:
http://wiki.remobjects.com/wiki/Login_and_Authentication

Execute ‘Get design time Data’ popup-menu command on TDAMemDataTable component.

Where is this article now, I need to refresh my memory

http://old.wiki.remobjects.com/wiki/Login_and_Authentication