Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/Database/DataSnap/Server    [ Add a report in this area ]  
Report #:  86608   Status: Closed
Missing IAppServer support on LifeCycle = ‘Invocation’
Project:  Delphi Build #:  14.0.3593.25826
Version:    14.0 Submitted By:   Dimitar Antonov
Report Type:  Basic functionality failure Date Reported:  7/27/2010 1:28:16 AM
Severity:    Serious / Highly visible problem Last Updated: 3/20/2012 2:24:39 AM
Platform:    All platforms Internal Tracking #:   278933
Resolution: Duplicate (Resolution Comments) Resolved in Build: : 15.0.3874.33628
Duplicate of:  84913
Voting and Rating
Overall Rating: No Ratings Yet
0.00 out of 5
Total Votes: None
Description
Hello!

I am trying to transfer a RAD Studio 2009 project to a RAD Studio 2010 and I encountered a problem. The problem has blocked my work with Delphi 2010!!!


Here is an example of two projects “Client” and “Server” side based on DataSnap 2010 technology.
On the server side we have
DSServerClass1.LifeCycle = Invocation

On the client side we want to use TClientDataSet functionality. That’s why we have a single button on pressing which we open a TClientDataSet.
And we receive an error message:
“Remote error: TServerMethods1.AS_GetRecords method not found in the server method list.”

Starting from https://forums.embarcadero.com/thread.jspa?threadID=27205&tstart=0
we made our research and made these conclusions:
There is difference between DataSnap 2009 and DataSnap 2010 here:

D2009: DSServer.pas: function TDSServerClass.GetDSClass: TDSClass;
Line 563:
IsAdapted := PersistentClass.InheritsFrom(TProviderDataModule);

D2010: DSServer.pas: function TDSServerClass.GetDSClass: TDSClass;
Line 571:
IsAdapted := PersistentClass.InheritsFrom(TProviderDataModule) and (LifeCycle <> TDSLifeCycle.Invocation);
So when we have “DSServerClass1.LifeCycle = Invocation” in DataSnap 2010 we have IsAdapted evaluated to “false” which prevents code running inside
if IsAdapted then
  Result := TDSClass.Create(TDSProviderDataModuleAdapter, Result);
When this second constructor is not used
constructor TDSClass.Create(AClassRef: TPersistentClass; AAdapteeClass: TDSClass);
begin
  inherited Create;
  FClassRef := AClassRef;
  FAdapteeClass := AAdapteeClass;
end;
then
we don’t have an instance of the TDSClass where FAdapteeClass field is assigned.

Later on when it comes to listing all the methods exposed to the client, e.g. “callable” methods we run into
function TDSClass.GetMethods: TDSMethodArray;
begin
  Result := nil;
  if Assigned(FAdapteeClass) then
    AddMethods(FAdapteeClass);

  AddMethods(Self);
end;
Since FAdapteeClass is not assigned GetMethods returns only the actually declared public methods in  TServerMethods1 where method “Get_Records” is really missing.

When “DSServerClass1.LifeCycle = Session” then we have the server class instantiated from TDSProviderDataModuleAdapter thanks to
Result := TDSClass.Create(TDSProviderDataModuleAdapter, Result);

And this exactly TDSProviderDataModuleAdapter provides the methods supporting the TClientDataSet on the client application.

So the question is:
How can we have “DSServerClass1.LifeCycle = Invocation” and TClientDataSet functionality supported in the same time?
Steps to Reproduce:
1. Compile both projects.
2. Run both applications.
3. In the client application press button "Open".
4. You will receive an error message: “Remote error: TServerMethods1.AS_GetRecords method not found in the server method list.”


To run this example you will need the employee.jds file which on my machine is on this path:
C:\Users\Public\Documents\RAD Studio\7.0\Demos\database\databases\BlackfishSQL\employee.jds
Workarounds
None
Attachment
DataSnap 2010 Project.zip
Comments

Tomohiro Takahashi at 7/27/2010 6:40:40 PM -
Is your issue same as QC#84913 ?

Dimitar Antonov at 7/27/2010 11:47:28 PM -
Yes, it's the same.

Will be there a fix? It is very important vor me!

Tomohiro Takahashi at 7/28/2010 12:31:34 AM -
> Will be there a fix?
As you know, QualityCentral is not technical support service. So, if possible, please contact technical support. Sorry for inconvenience.
http://support.embarcader.com/

Dimitar Antonov at 9/17/2010 2:10:03 AM -
Hi,

I see, that the problem is resolved.
How can i receiva a fix?

Best regards,
Dimitar Antonov

Tomohiro Takahashi at 9/17/2010 9:51:37 PM -
Please see 'Resolved In Build' field. It is set to 15.0.xxx.xxx. It is Delphi XE.
So, unfortunately, this issue is fixed with Delphi XE.

Server Response from: ETNACODE01