Hi,
I used ROHttpApiSimpleAuthenticationManager+ROHttpApiDispatcher to do the login security and session to do a HtppAPI +DA project.
It is working correctly for most of the case.
However one of the function I used TDALocalDataAdapter in below code:
lda := TDALocalDataAdapter.Create(Self.Name);
cdsAfvs := TDAMemDataTable.Create(nil);
cdsAfvs.LogicalName := 'Afvs_TBL';
cdsAfvs.RemoteDataAdapter := lda;
cdsAfvs.RemoteFetchEnabled := True;
cdsAfvs.DynamicWhere.Expression := cdsAfvs.DynamicWhere.NewBinaryExpression(
cdsAfvs.DynamicWhere.NewField('','Afvs_ID_PK'),cdsAfvs.DynamicWhere.NewConstant('-1'), dboEqual);
cdsAfvs.Open;
cdsAfvs.append;
// field value assignement
cdsAfvs.post;
cdsAfvs.applyupdate.
The above I hit session error. I find in other post advise to
lGUID := NewGuid;
lSession := ServerDataModule.SessionManager.CreateSession(lGUID);
ServerDataModule.SessionManager.ReleaseSession(lSession, true);
DALocalDataAdapter1.SessionID := lGUID;
Use this way to assign session, will it violate or delete the current active session?
or what is the suugested way to do it?
Actually what is the suggested way to do dataset add change delete at service side with session suppport?
As Currently I defined a function and passed a TRoComplexType and manually process to the dataset update.
Please advise