FireDAC suitable as data-access component in DataSnap server?

Hello Folks!

In Delphi XE3, when FireDAC became available, I tested it as a possible replacement for +dbExpress+ on the app server side (DataSnap server). I discovered that the IProviderSupport methods of +TADDataSet+ implemented the method +PSUpdateRecord+ by opening the query again, positioning itself on the correct record, go into edit mode and apply the change. This is in stark contrast to +TCustomSQLDataSet.PSUpdateRecord+, which just returns False and forces the +TSQLResolver+ to generate the appropriate update 
SQL command in +TSQLResolver.InternalDoUpdate+. Obviously opening the dataset and locating the correct record is an overhead we would like to avoid.

Now looking at Delphi XE5 I am disappointed that TFDDataSet.PSUpdateRecord is still implemented the same way although there are IProviderSupport methods on TFDAdaptedDataSet such as:
* PSGetCommandText,
* PSSetParams &
* PSExecuteStatement

My +TDataSetProvider.ResoveToDataSet+ is set to False but the +TFDQuery+ does its own thing and ignores the setting.

Here is the call stack of my app server:

{code}
FireDAC.Comp.DataSet.TFDDataSet.OpenCursor(False)
FireDAC.Comp.Client.TFDRdbmsDataSet.OpenCursor(False)
Data.DB.TDataSet.SetActive(???)
FireDAC.Comp.DataSet.TFDDataSet.SetActive(True)
Data.DB.TDataSet.Open
FireDAC.Comp.DataSet.TFDDataSet.PSUpdateRecord(ukModify,$530C1B0)
Datasnap.Provider.TSQLResolver.InternalDoUpdate($3A85D80,ukModify)
Datasnap.Provider.TSQLResolver.DoUpdate(???)
Datasnap.Provider.TCustomResolver.InternalUpdateRecord($3A85D80)
Datasnap.Provider.TUpdateTree.DoUpdates
Datasnap.Provider.TCustomResolver.ApplyUpdates(Variant array of Byte,0,0)
Datasnap.Provider.TBaseProvider.InternalApplyUpdates(Variant array of Byte,0,0)
Datasnap.Provider.TDataSetProvider.InternalApplyUpdates(Variant array of Byte,0,0)
Datasnap.Provider.TCustomProvider.DoApplyUpdates(Variant array of Unknown,0,0,Unassigned)
Datasnap.Provider.TCustomProvider.ApplyUpdates(Variant array of Byte,0,0,Unassigned)
Datasnap.DSServer.TDSProviderDataModuleAdapter.AS_ApplyUpdates('dspEmployee',Variant array of Byte,0,0,$3AB1360)
System.ObjAuto.ObjectInvoke($3A6B8D8,$7ECF1D,(...),(...))
Datasnap.DSReflect.TDSMethod.Invoke($3A6B8D8,$3A959A0)
Datasnap.DSCommonServer.TDSServerMethod.Invoke($537F170)
Datasnap.DSCommonServer.TDSServerMethodCommandHandler.DbxExecute($537F170)
Datasnap.DSCommonServer.TDSServerConnectionHandler.DbxExecute($537F170)
Data.DBXMessageHandlerCommon.TDBXExecuteMessage.HandleMessage(???)
Data.DBXMessageHandlerJSonServer.TDBXJSonServerInputConnectionHandler.DbxExecute($537F170)
Data.DBXMessageHandlerJSonServer.TDBXJSonServerInputConnectionHandler.HandleDbxRequest
Data.DBXMessageHandlerJSonServer.TDBXJSonServerInputConnectionHandler.HandleNonBlockingProtocol
Data.DBXMessageHandlerJSonServer.TDBXJSonServerProtocolHandler.HandleNonBlockingProtocol
Datasnap.DSTCPServerTransport.TDSTCPServerTransport.DoOnExecute(TIdContextPeer($3A7EF10) as IIPContext)
IPPeerServer.TIdTCPServerPeer.LOnExecuteEvent(???)
IdCustomTCPServer.TIdCustomTCPServer.DoExecute($3ABD620)
IdContext.TIdContext.Run
IdTask.TIdTask.DoRun
IdThread.TIdThreadWithTask.Run
IdThread.TIdThread.Execute
System.Classes.ThreadProc($3A06860)
System.ThreadWrapper($3A71640)
:760d33ca kernel32.BaseThreadInitThunk + 0x12
:77c69ed2 ntdll.RtlInitializeExceptionChain + 0x63
:77c69ea5 ntdll.RtlInitializeExceptionChain + 0x36
{code}

It would be nice if FireDAC would cooperate better with DataSnap & +TSQLResolver+.

Salut,
  +Mathias+
0
Mathias
10/15/2013 11:08:55 AM
embarcadero.datasnap 643 articles. 0 followers. Follow

0 Replies
1126 Views

Similar Articles

[PageSpeed] 16

Reply:

Similar Artilces:

Updating data back to datasnap server with FireDac TFDStoredProcedure
I am currently using Delphi XE5 and FireDac to try and create a test app for Datasnap client. I use a standard TFDQuery on the server side to retrieve the data and send the dataset back to the client. On the client side I connect to the datasnap server fine using a TFDStoredProcedure. This all works perfectly, but when I try and use ApplyUpdates to write the data back I get an exception and the client crashes. The questions are: 1. can you use the ApplyUpdates method with FireDac and Datasnap? 2. If so what is the best way of getting the updates back to the datasnap server? Than...

Datasnap Rest client and no datasnap server
Hi, it's possible to use a delphi datasnap rest client to consume a rest web services written in other lenguages (like java or php) or i have to use an idhttp (or other) component? Thanks. Bye Pasquale Di Giovanni wrote: > > it's possible to use a delphi datasnap rest client to consume a rest > web services written in other lenguages (like java or php) or i have > to use an idhttp (or other) component? You could in theory, but it may be more trouble than its worth. You'd probably have to have control of the REST server so you can implement all the...

Indy 10
This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --JivePart=_39eb5.zeB8CwDOH5aMJzMl Content-Type: text/plain; charset="Utf-8" The udp client component would be used in the datasnap server. The udp server component would be used in the datasnap client. --JivePart=_39eb5.zeB8CwDOH5aMJzMl Content-Type: application/x-zip-compressed; name="UDPDSClinetstub.zip" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="UDPDSClinetstub.zip" UEs...

DataSnap REST Server as ISAPI calling a COM Object/Server -> access denied
Hello, I have an DataSnap REST Server published on an IIS webserver as ISAPI. The REST Server calls a COM Server. If I create a normale VCL test client which calls the COM Server it will work. If I call the COM Server from the ISAPI I get the error "access denied". I think it is not a problem of Delphi DataSnap. It should be a problem of IIS user permissions. Did someone know how to setup IIS user permissions to work? Note: If I add the AppPoolUser to the admin group it will work. But it is not a good idea :-) regards M. Pannier ...

XE Datasnap Client expection with a XE2 DataSnap Server.
I have developed a simple DataSnap Server on XE2 and the client that connects to this server is under XE. Everything works just fine except when freeing the ClientProxy Module on the client side I get the following exception " TDXError with message Invalid Ordinal 3." followed by a AV. Any hints how to avoid this exception or the Server must be on XE also? Thanks in Advance, Omar Zelaya I have now the DataSanp Server on XE and the client no longer throws the exception. So the question now is, it is possible to use a XE DataSnap Client with a XE2 DataSnap Se...

Accessing the One sybase data server from the other data server.
Hello: I have a question in Sybase. I have two dataservers and want to access tables from one data server from another data server. The sybase version is 12.5 Is it possible to do so?. Thanks Param On Thu, 28 Oct 2004 19:06:50 -0700, param wrote: > Hello: > > I have a question in Sybase. I have two dataservers and want > to access tables from one data server from another > data server. Look up proxy tables in the manuals (and the "create existing table ..." command). Michael -- Michael Peppler [TeamSybase] mpeppler@peppler.org - http://w...

Connect Old Datasnap Clients with new datasnap Server ? [Edit]
Is it possible to connect a XE5 datasnap server with Borland C++ 6 Datasnap clients ? I want to know this before starting ... Edited by: Bart vd Voort vd Kleij on Jan 9, 2014 11:49 PM Edited by: Bart vd Voort vd Kleij on Jan 9, 2014 11:51 PM ...

DataSnap Server Access Violation [Edit]
Hello We are using Delphi 2010 and we build DataSnap Application Servers with DBX components. We use LifeCycle = Session for the TDSServerClass components. Of course we’d like to have LifeCycle = Invocation but for Delphi 2010 you know there is a registered problem with the TClientDataSet functionality under “Invocation” mode. Even with LifeCycle = Session we struggle to keep our logic to be a “stateless” one. Thus we close all connections to DataSnap server when we finish calling a remote method or having the needed data transported to the client. So we suffer an undefined problem ex...

Testing Data Access Components using NUnit and Enterprise Data Access Block
Hi,I have installed the WSF (Web Service Software Factory) and am using it for my development. I know want to test my business layer that calls to my data layer using NUnit. I have a problem though. When I run my project in development mode everything is fine - the database connection is picked up in from the web.config of my Host project. However when I try to run my test library (which is just a class library with the NUnit GUI setup to launch on starting up the class library), I have problem in that there is nowhere to define my database connection in a app.config or web.config file....

Datasnap
Hi All, Database: Firebird 1.5 Server: TADConnection -> TADQuery -> TDatasetProvider Client: SQLConnection -> TDSProviderConnection -> TClientDataset I get "Remote Error: Access violation" when executing ApplyUpdates(-1), but I don't get error on my development Notebook. When I trace on server the error raise between BeforeApply and AfterApply. Any suggestion welcome. Thanks Jay Hello Jayanto This information is not sufficient. Could you provide the call stack of the place where exception is raised ? -- With best regards, Dmitry Arefiev ...

FireDAC as DataSnap Server with Firebird Database XE5
Hi, I use Firebird Database with Firedac as Server for DataSnap and I don't see my alias on client side. For example, a query like this don't provide me the TEST Field. SELECT MU.*, MU.NAME!!' '!!MU.FIRSTNAME AS TEST FROM MYUSERS MU With dbexpress, it works well. Somebody notice this ? Hello Hugues > SELECT MU.*, MU.NAME!!' '!!MU.FIRSTNAME AS TEST FROM MYUSERS MU 1) What "!!" means there ? 2) Still if the SQL syntax is correct, then you should set ResourceOptions.MacroCreate and MacroExpand to False: http://docwiki.embarcadero.com/R...

Are DataSnap Servers Thread Safe with DB Components?
We are trying out and designing new DataSnap Server and Client applications. We have coded our DataSnap server using the TUniQuery component for DB connectivity to a MySQL DB. In our DataSnap server we have created a ServerMethods class that implements the common functions we will need to talk to the DB and return the data to the Client Apps. We have been discussing this amongst ourselves, but would like to understand how this will really work... Is the DataSnap server thread safe? For example we have one TUniQuery component on the ServerMethods class that is used to get the results a...

DataSnap vs RemObjects Data Abstract + Relativity Server
Hi, Does anyone have any experiences or thoughts about RemObjects DA + Relatvity Server vs DataSnap? Relativity Server looks like it makes things pretty easy. With DataSnap, creating TSQLQueries on the server, running the server, and adding TClientDataSets on the client is a bit of a pain. Working is MS SQL Server IDENTITY columns in DataSnap is problematic. TADOQuery works with IDENTITY columns, but doesn't have the best performance. RemObjects claims that their tools provide good performance. RemObjects has no support for SQL Server's geography datatype and has not p...

Transferring data from one database to another both on same DataSnap Server
Hello, I have one DataSnap Server with two databases: InterBase and MSSQL; the core database is InterBase and every day I need to transfer the data from one table of MSSQL to the identical table on InterBase, because it is much more simple to manage many other functions of the application directly on the InterBase database. The problem is that I can´t access form Unit1 of DataSnap Server, where I want to make this data transfer using a piece of code, to ServerMethodsUnit1 where are the datasets of both databases . When I try to access to the ServerMethodsUnit1 datasets I received a Li...

Web resources about - FireDAC suitable as data-access component in DataSnap server? - embarcadero.datasnap

Data access - Wikipedia, the free encyclopedia
Data access crucially involves authorization to access different data repositories. Data access can help distinguish the abilities of administrators ...

Russian Search Engine Yandex Reaches Deal To Access Facebook’s Firehose Of Public Data
Russian search engine Yandex reached an agreement with Facebook, giving it access to the social network’s “ firehose ” of public data for the ...

Facebook Announces Significant Changes to the Way Applications Can Access User Data
... of Canada, Facebook this morning announced significant changes to the ways application developers have access to Facebook user data. While no ...

Christopher Cuong Nguyen's answer to Gmail: How many Google employees can access Gmail data? - Quora
Christopher Cuong Nguyen's answer: A small number of GMail-related engineers have access to the servers as a matter of necessity to do their ...

Obama urges Congress on data access
US President Barack Obama has urged Congress to prevent surveillance measures from lapsing on Sunday.

NSW Police want warrantless bank data access
NSW police officers would no longer require a judge's sign-off to gain access to the bank statements of people they suspect are engaging in criminal ...

NSA to cut system administrators by 90% to limit data access
The NSA will eliminate about 90 per cent of its system administrators to reduce the number of people with access to secret information.

Twitter, PeopleBrowsr Settle Legal Dispute Over Data Access: Firehose
Jodee Rich has reached a settlement with Twitter that allows his social media analytics firm PeopleBrowsr to continue to buy Twitter's data until ...

Feds Wanted More Smartphone User Data Access, Documents Show
The federal government recently tried to expand its ability to carry out surveillance on smartphones, the Globe and Mail reports, but wireless ...

Lawmakers grill Apple’s Cook on iOS developer data access following Path address book privacy debacle ...
... the letter asserts there have been claims that the practice of collecting address book data without users’ consent is “common and accepted among ...

Resources last updated: 1/21/2016 11:08:47 AM