datasnap

Datasnap\FireDAC: Query executed twice

≡放荡痞女 提交于 2019-12-13 05:38:55
问题 I have the following problem: 1) I use Delphi XE7 to develop a 3-layer system. 2) The server layer, created with datasnap using REST. 3) I use Firebird as database and the access is performed with FireDAC. 4) I have a sequence with value 01 . 5) I created the following query in the server layer: Select GEN_ID (gen_my_sequence, 1) from rdb $ database 6) On the server returns the sequence value in the query is: 02 . 7) But the client layer returns 03. I do not understand why the query is

How to pass message to TApartmentThread Instance without creating Windows handle

自作多情 提交于 2019-12-12 17:04:45
问题 I wish to be able to post messages from the main application of a DataSnap automation server to the RemoteDataModule instances created to service clients. I understand from other forum entires, such as: Delphi Multi-Threading Message Loop That messages can be handled in threads without the need to create a Windows handle for the purpose; messages posted with PostThreadMessage. However the DataSnap TComponentFactory creates a TApartmentThread instance for each RemoteDataModule, and it's

DataSnap and the autoinc field

假如想象 提交于 2019-12-11 08:09:15
问题 I would like my table to have the autoinc field but doing an insert on it using ClientDataSet causes 'field must have value' error. It seems Datasnap server does not know it should generate one by itself and expects a value. For the demo I created a simple table with only 2 fields : ID (autoinc) and DATE (varchar). The database is SQLite. procedure TForm3.Button1Click(Sender: TObject); begin ClientDataSet1.Insert; ClientDataSet1.FieldByName('DATE').Value:= DateUtils.DateOf(PlannerCalendar1

Hooking into message loop of dbx DataSnap user session

五迷三道 提交于 2019-12-11 01:59:55
问题 Is there a way to hook into the WndProc of a dbx user session? Background: dbx DataSnap uses Indy components for TCP communication. In its simplest form, a DataSnap server is an Indy TCP server accepting connections. When a connection is established, Indy creates a thread for that connection which handles all requests for that connection. Each of these user connections consume resources. For a server with a couple hundred simultaneous connections, those resources can be expensive. Many of the

Delphi XE5 Rest Datasnap Server. Getting Client IP Address

元气小坏坏 提交于 2019-12-11 01:47:31
问题 I'm trying to get a client's IP address and other client information using DSServer 's onconnect event with the following code. My problem is that DSConnectEventObject.ChannelInfo is nil every time. Additionally, I can't resolve the IP addresses. Please help me. Thank you. procedure TWebModule1.DSServer1Connect(DSConnectEventObject: TDSConnectEventObject); var ci: TDBXClientInfo; begin ci := DSConnectEventObject.ChannelInfo.ClientInfo; AddLog(Format('Client %s Connected IP: %s, Port: %s', [ci

How to direct DataSnap client connections to various DS Servers?

半腔热情 提交于 2019-12-10 19:49:37
问题 I have a quite big DataSnap server that will be running 24/7, it will substitute a currently running MIDAS (COM) server. Now I'm facing the problem of how to update that server without having to force disconnection of all connected clients. With the current midas server (that, by the way, doesn't have a huge traffic to serve) I simply wait until there are no connections, then shut down the server application and substitute the exe file. If a new connection occurred while the server was "down"

Delphi - Unit x was compiled with a different version of x, when fixing a VCL bug

删除回忆录丶 提交于 2019-12-10 19:04:51
问题 I am using Delphi XE6 and using Datasnap and JSON in my project. There is a bug I want to correct in the VCL unit System.JSON.pas (in the TJSONString.ToString function) where it should be escaping backslash characters as well as quotes. In order to fix this I carried out the following : Copied System.JSON.pas from the standard VCL source folder to my project source folder Added System.JSON.pas to my project (using the newly copied file) Fixed the bug and attempted to compile I get the error

REST Datasnap override URI mapping

社会主义新天地 提交于 2019-12-10 17:46:11
问题 I wrote a small REST server with the REST datasnap in delphi XE2. There is a default mapping between HTTP methods (POST, PUT etc.) and the functions defined in delphi, this is done by a delphi component. This wiki entry describes the URI mapping but also notes that the default mapping can be override by the programmer. The mapping pattern can be overridden. The user can override the mapping for each type based on class name and method name parameters. But I didn't find any explanation how to

How to embed the MIDAS.DLL in the client executable

前提是你 提交于 2019-12-10 15:25:33
问题 According to dr. Bob it can be done. Can someone provide step by step example or some tutorial? 回答1: You don't embed MIDAS.DLL; you add MidasLib to your project's USES clause. This embeds the basic functionality into your program without having to rely on a separate DLL for it. 来源: https://stackoverflow.com/questions/21604082/how-to-embed-the-midas-dll-in-the-client-executable

How to read the Fields:{} content inside a JSON result using JQuery?

橙三吉。 提交于 2019-12-10 11:56:51
问题 I'm fresh to this whole JSON and JQuery thing, and I'm trying to read a JSON structure coming from Delphi datasnap, e.g : {"result":[[{"type":"VOMesas.TMesas","id":1,"fields":{ "FUsers":1,"FEnclosing":0,"FClientName":"","FCode":100,"FStatus":1,"FTotalValue":128.25}}]]} How can I read it with JQuery, more especifically the Fields:{...} content ? EDIT : here is the function im trying to do function getContent(order) { $.getJSON("query.json", function(data) { $.each(data.result, function(i, item