Jump to content

Sonjli

Members
  • Content Count

    110
  • Joined

  • Last visited

Everything posted by Sonjli

  1. Hello, I hope to be in the right place. Also, I don't find this behaviour in forum neither in embt quality. I am in debug with a breakpoint inside an anon method and when I try to evaluate a variable (CTRL + F7, mouse over, watches, etc. ) I get a "undeclared identifier" if I use a class field. Example: TmyDM = class(TDataModule) Comp: TADOQuery; ... end; ... procedure ...blabla...; var CompForDebug: TADOQuery; begin Comp.Close; Comp.Parameters.ParamByName('test').Value := 100; Comp.Open; // <-- Here evaluate "Comp". I get the right thing FmyList.ForEach( procedure(const obj: IMyThing) var CompForDebugLocal: TADOQuery; begin Comp.Close; Comp.Parameters.ParamByName('test').Value := 100; Comp.Open; // <-- Here evaluate "Comp". I get "Undeclared identifier" // This doesn't work: CompForDebugLocal := Comp; CompForDebugLocal.Close; CompForDebugLocal.Parameters.ParamByName('test').Value := 100; CompForDebugLocal.Open; // <-- Here evaluate "Comp". I get "Undeclared identifier" // This doesn't work: CompForDebug := Comp; CompForDebug.Close; CompForDebug.Parameters.ParamByName('test').Value := 100; CompForDebug.Open; // <-- Here evaluate "Comp". I get the right thing end ); end;
  2. Added embt quality https://embt.atlassian.net/servicedesk/customer/portal/1/RSS-1922
  3. Ok, thanks. I needed a confirmation. Same exact behaviour is for inline variables inside anon method... no way to evaluate them during debug. It's frustrating if you are working with Spring4d or other modern libraries.
  4. Same problem here I will promote RSS-1834
  5. Sonjli

    PAServer docker output

    Hi, do you know what is this output for PAServer on Linux (Ubuntu 22.04)? The CPU is very high. I don't know what's happening.
  6. Hello, I found an issue using the rtl THTTPClient.Post method in Linux. If I use a windows client that makes the post to Linux server, all working like a charm. If I use a linux client (paserver via docker container) the post works but the server doesn't understand tha call. If I use TIdHTTP instead, all keep working like a charm. Any idea about this? Isn't the standard RTL completely cross platform?
  7. Sonjli

    PAServer docker output

    I think I have to give up... 😭
  8. Sonjli

    THttpClient vs TIdHttp in Linux

    Non for now. Can you recommend me a simple sniffer? (wireshark is too much for me...) Or is there any other way to capture the raw request?
  9. Sonjli

    THttpClient vs TIdHttp in Linux

    I am using keycloak for oauth2. The POST to retrieve the jwt token works perfectly with indy in linux container. Keycloak gives me a "java.lang.StringIndexOutOfBoundsException" when I use THttpClient. If I compile under Windows and do the POST from windows to keycloak both works. If I compile my app for Linux: Indy works, THttpClient doesn't work If I compile my app for Windows: Indy works, THttpClient works
  10. Sonjli

    PAServer docker output

    Anyone out there ? Tell me if you need more infos. I'm a little messed up...
  11. Hello, I have to use an external (horrible... 🤮) REST api that gives me a lot of data. In one case I have over 60.000 json records by day, so for one year it starts from 60k x 365. And the customer need all that data. For now I work day by day, but it is not an option. I would like to "stream" the data coming from webservice and use an async thread to "eat" the json while streaming. How can I get it in Delphi? Is it possible? (Other ideas are welcome! ) Thanks!
  12. Sonjli

    REST api: too much data

    Sorry, you're right. Mine is JSON data and still compressed, not XML. Thanks!
  13. Sonjli

    REST api: too much data

    Thanks. Another good one. Small sqlite db loaded with "batch night", yes.
  14. Sonjli

    REST api: too much data

    Hi. It is a monolithic json. Parallel consumers can be an option (one day per task, for example), yes. I have to plan correct boundaries (day, week, etc.), but yes, good one.
  15. Sonjli

    Problems closing IDE

    Hello, I have two strange issues when closing IDE. The first: IDE closes but it persist in memory so I have to kill the process The second: The IDE closes but one or two of exceptions come to life I have a lot of experts installed and I know for sure these problems are for this cause. So, I tried to remove them one by one and open\close the IDE. I tried in various combinations. A lot of loss time. Every time a different behaviour. The problem seems to be very random. If I have none of the experts installed, issues go away as if they never existed I don't want THE solution, I understand. My question is: is there any tool (logger, external debugger, etc.) to try to catch the problem? Thanks
  16. Hello. In this source unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Spring.Collections; type IScarafuglio = interface(IInvokable) ['{8E5CC1F0-8759-4965-BF83-0C2DC5E1153C}'] function Nome: string; function cognome: string; function Eta: Integer; end; IPippo = interface(IInvokable) ['{C6B11B79-F08C-47D0-9E21-EBE4788E43E1}'] function PlutoList: IReadOnlyList<IScarafuglio>; end; TForm2 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); var a: IPippo; begin // Use the RTTI in Unmarshal a := Unmarshal<IPippo>( ''' { "PlutoList": [ { "Nome": "Eddy", "cognome": "Mazzarini", "Eta": 22 }, { "Nome": "Luca", "cognome": "Vecchiato", "Eta": 56 } ] } ''' ); ShowMessage(a.PlutoList[1].Nome); // AV because IScarafuglio instance is nil end; end. the interface IScarafuglio is never found with Context.FindType('Unit2.IScarafuglio'); The result i always nil. But if I add a simple field or anything else that reference the IScarafuglio in interface, then everything is fine: unit Unit2; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Spring.Collections; type IScarafuglio = interface(IInvokable) ['{8E5CC1F0-8759-4965-BF83-0C2DC5E1153C}'] function Nome: string; function cognome: string; function Eta: Integer; end; IPippo = interface(IInvokable) ['{C6B11B79-F08C-47D0-9E21-EBE4788E43E1}'] function PlutoList: IReadOnlyList<IScarafuglio>; end; TForm2 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } XYZ: IScarafuglio; // From now everything is fine and RTTI "know" who IScarafuglio is... public { Public declarations } end; implementation {$R *.dfm} procedure TForm2.Button1Click(Sender: TObject); var a: IPippo; begin // Use the RTTI in Unmarshal a := Unmarshal<IPippo>( ''' { "PlutoList": [ { "Nome": "Eddy", "cognome": "Mazzarini", "Eta": 22 }, { "Nome": "Luca", "cognome": "Vecchiato", "Eta": 56 } ] } ''' ); ShowMessage(a.PlutoList[1].Nome); // WORKING!!! end; end. Why this behaviour? Thanks
  17. Very strange you never heard about FidoLib: the best library after the invention of programming (and Sprign4d, for sure ) jokes apart, Thanks for your help!
  18. Yes. The code is in FidoLib (I collaborate in the project). The file is this: https://github.com/mirko-bianco/FidoLib/blob/develop/source/Json/Fido.JSON.Marshalling.pas
  19. This was not the point, for me. I just would like to know why the RTTI doesn't know nothing about IScarafuglio until it is declared. Anyway I am looking for the use of that prop in my code.
  20. I stepped on shit... ok, I clean my shoe and Wirth can go back to rest in peace...
  21. It would be nice to add inline methods writing in classes. I mean declaration and implementation all in the class. Example: // Inline implementation type TMyClass = class private procedure DoSomething; begin ShowMessage('Hello guys!'); end; public end;
  22. Sonjli

    FireDAC SQLite MetaDefCatalog

    Hello, I am trying to execute this SQL with FireDAC in D12 ent: create table if not exists mydb.mytable (name varchar(100) unique not null); With FDConnection.ExecSQL(...); These are the params I pass to the connection: DriverID=SQLite Database=mydatabase.db MetaDefCatalog=mydb CreateDatabase=True As I read in Embarcadero docs: https://docwiki.embarcadero.com/RADStudio/Alexandria/en/Connect_to_SQLite_database_(FireDAC) Well, the SQL with the "mydb" alias does not work. If I use "MAIN" (look at next sql) then it works, whatever "MetaDefCatalog" value I set! create table if not exists MAIN.mytable (name varchar(100) unique not null); -- <-- WORKS! create table if not exists mytable (name varchar(100) unique not null); -- <-- WORKS! create table if not exists mydb.mytable (name varchar(100) unique not null); -- <-- DOESN'T WORK! Thanks, Eddy
  23. Sonjli

    FireDAC SQLite MetaDefCatalog

    FYI everything works like a charm. Thanks again
  24. Sonjli

    FireDAC SQLite MetaDefCatalog

    wooo, never used this feature... thank you!
×