#1 mORMot 2 » convert json to csv » 2025-04-02 15:42:39

is there a function that i can use to convert a json to csv ?

#2 mORMot 2 » 500 Unrecognized Command Error with QUIT in mORMot's SendEmail » 2025-03-12 11:40:59

Hi,

I’m currently working with mORMot's SendEmail function and encountering an issue when sending emails via SMTP. The email gets delivered successfully, but when the function attempts to execute the QUIT command to terminate the session, it returns a 500 Unrecognized command error.

I also tried connecting manually via an SMTP test tool, and the email was sent successfully without sending a QUIT command at the end. The exchange was as follows:

<< 220-youssef.genious.net ESMTP Exim 4.98.1 #2 Wed, 12 Mar 2025 10:27:51 퍍
<< 220-We do not authorize the use of this system to transport unsolicited,
<< 220 and/or bulk e-mail.
>> EHLO [172.31.12.132]
<< 250-youssef.genious.net Hello ec2-54-212-131-181.us-west-2.compute.amazonaws.com [54.212.121.163]
<< 250-SIZE 52428800
<< 250-LIMITS MAILMAX=1000 RCPTMAX=50000
<< 250-8BITMIME
<< 250-PIPELINING
<< 250-PIPECONNECT
<< 250-AUTH PLAIN LOGIN
<< 250-STARTTLS
<< 250 HELP
>> AUTH PLAIN AHNhbGFoQG9tbmZXR3b3Jrcy5v
<< 235 Authentication succeeded
>> MAIL FROM:< 'here is the email sender ' > SIZE=561
>> RCPT TO:<' here is the email recevier '>
<< 250 OK
<< 250 Accepted
>> DATA
<< 354 Enter message, ending with "." on a line by itself
[Email headers and body content]
>> .
<< 250 OK id=1tsJJY-000000006xW-2a10


   sock.SockSend(Text);
    Exec('.', '25');
    Exec('QUIT', '22'); // this command gives me erreur : 500 unrecognazed command
    result := ioresult = 0; 

#4 mORMot 2 » serialize and deserialize JSON in a cross-platform » 2024-12-11 17:31:47

Hi, I want to ask: Is there any way to serialize and deserialize JSON in a cross-platform FMX application (e.g., for Android) using mORMot, similar to the RecordSaveJSON() and RecordLoadJSON() functions? I read in the documentation that we can use JSONVariant, but this just converts JSON to a variant. I'm looking for a solution that would allow proper serialization and deserialization of records or objects, as those functions do.

#5 Re: mORMot 2 » i have ian issue with concurrent calls to a function in SOA » 2024-10-28 08:37:22

//My server initiates 32 threads after it calls root/timestamp and root/EmpService._contract_.

//Then, it calls the function TestThread.

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 28.67 s
mormot.rest.server.TrestServerRoutingRest(03fe3880) {"result":["30000"]}
28.678.115

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 32.76 s
mormot.rest.server.TrestServerRoutingRest(03fe3580) {"result":["30000"]}
32.769.536

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 32.13 s
mormot.rest.server.TrestServerRoutingRest(03fe3b80) {"result":["30000"]}
32.134.841

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 32.20 s
mormot.rest.server.TrestServerRoutingRest(03fe3a00) {"result":["30000"]}
32.208.935

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 31.77 s
mormot.rest.server.TrestServerRoutingRest(03fe3e80) {"result":["30000"]}
32.780.074

Interface Post: root/EmpService.TestThread = 200 out, 20 B in, 33.57 s
mormot.rest.server.TrestServerRoutingRest(03fe3d00) {"result":["30000"]}
32.582.705

trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=1390 'Httpsrv 11111 root ThttpsrvResp' thread count = 6
trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=02a8 'Httpsrv 11111 root ThttpsrvResp' thread count = 5
trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=88 'Httpsrv 11111 root ThttpsrvResp' thread count = 4
trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=13a4 'Httpsrv 11111 root ThttpsrvResp' thread count = 3
trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=1de4 'Httpsrv 11111 root ThttpsrvResp' thread count = 2
trace unit6.TsimpleServer(039b86c0) End current thread (THttpServerResp) Thread ID=1de4 'Httpsrv 11111 root ThttpsrvResp' thread count = 1


The server always returns a result, but in the console of my test, I get a timeout error if I call the function more than six times. If I call it fewer than six times, I receive the result in the test console.

I can also call the function concurrently more than six times and receive the result in the test console, but I have to increase the number of iterations from 30,000 to less than 20,000.


this is the erreur in the test console  :
EXC EInterfaceFactory {Message: "TInterfacedObjectFakeClient.FakeCall(IEmpService.TestThread) failed: 'URI root/IEmpService.TestThread [] return status 'Request Timeout' (408)"} [main] at 7a526d

#6 Re: mORMot 2 » i have ian issue with concurrent calls to a function in SOA » 2024-10-26 09:50:11

When I change the number of iterations in the function from 40,000 to 30,000, I can call the function 6 times concurrently. However, when I try to call it 7 times concurrently, they all give me a timeout.

#7 Re: mORMot 2 » i have ian issue with concurrent calls to a function in SOA » 2024-10-26 09:10:02

I am using sicPerThread with a thread pool size of 32 and useHttpSocket. Each time I call the function, the server uses one thread to execute it. I called the function four times, and I have 32 threads in the pool. I don't know why I am experiencing a timeout.


  // creation of the server
  TSQLRestServerDB.Create(HttpPort, [tsimpleserver], '+', useHttpSocket);//32 in the thread pool by default


constructor tsimpleserver.Create(aModel: TORMModel; aDBFILENAME: TFileName);
begin
  inherited Create(aModel, aDBFILENAME); 
  ServiceDefine(TemployeeService, [IEmpService], sicPerThread); 
end;

#8 Re: mORMot 2 » i have ian issue with concurrent calls to a function in SOA » 2024-10-24 15:27:13

I'am working with Windows 10 in virtual machine using Delphi 12.0 Athens / C++Builder 12.0 Athens, product version of 23.0.

CPU : Common KVM processor: 2.10 GHz with 2 cores , 2 sockets  and  mormot 2.2

#9 mORMot 2 » i have ian issue with concurrent calls to a function in SOA » 2024-10-14 10:11:12

The function in the SOA is defined as follows:

function server.functiontotest: string;
var
  g: Integer;  
  ResultStr: string;
begin
  g := 0;
  ResultStr := '';
  while g < 40000 do
  begin
    ResultStr := ResultStr + IntToStr(g);  
    Inc(g);  // Increment g
  end;
  Result := ResultStr;  
end;

The function takes time to return a result. When I call the function with 2 or 3 clients, it returns the result successfully. However, when I call it more than 4 times, I always get a timeout error. Additionally, I am using sicShared for the SOA. Even when I try changing to sicPerThread, I still encounter the same problem.

Board footer

Powered by FluxBB