#1 2015-08-19 17:03:26

nostroyo
Member
Registered: 2015-08-19
Posts: 16

Replacing Datasnap

Hi!

I try to replace Datasnap (i'm afraid of what i read about it's performance and stability) with mormot. I use Datasnap only for the http communication (the SOA part). Do you have any advices for my migration?

I have just finished reading this post, where can i find the full source?

Thanks!

Offline

#2 2015-08-19 17:17:38

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Replacing Datasnap

Offline

#3 2015-08-21 14:48:17

nostroyo
Member
Registered: 2015-08-19
Posts: 16

Re: Replacing Datasnap

OK i rewrote my client and server to use interface-based services, it's very powerful.

I have a problem when i want to use on the server side my object wich implement the interface, it's TServiceCalculator in the demo. never be Created, when a method is calling by the client an AV occur because the constructor never be called. I tried different Instances life time (sicSingle, sicShared...) but it doesn't change anything. Is there something i must do to solve this?

Offline

#4 2015-08-21 15:33:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Replacing Datasnap

I do not understand what you mean.

Instances are created on need, or may  be supplied for sicShared.

Offline

#5 2015-08-21 16:26:36

nostroyo
Member
Registered: 2015-08-19
Posts: 16

Re: Replacing Datasnap

Here my class on the server side :

  
TCollDbFunc = class(TInterfacedObject, IColleaguesFunc)
  private
    FDORMConfigCtrl: TDORMCtrl;
    FLstCtrl: TListCtrl;

    function GetAdvantagesList(ASession: TSession): TAdvantages;
  public
    constructor Create;
    destructor Destroy; override;


    function GetColleagues: string;
end;

When I call GetColleagues from the client, the constructor has never be called before so my nested object FDORMConfigCtrl is nil.

Offline

#6 2015-08-21 17:51:09

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Replacing Datasnap

The framework has no knowledge of this static constructor.

Just inherit from TInterfacedObjectWithCustomCreate, and override the default virtual constructor.
As stated by the doc in http://synopse.info/files/html/Synopse% … #TITLE_407
smile

Offline

#7 2015-08-22 10:46:50

nostroyo
Member
Registered: 2015-08-19
Posts: 16

Re: Replacing Datasnap

Thank you it's working!

Offline

Board footer

Powered by FluxBB