Jump to content

Jacek Laskowski

  • Content Count

  • Joined

  • Last visited

Community Reputation

17 Good

About Jacek Laskowski

  • Birthday 08/16/1973

Technical Information

  • Delphi-Version
    Delphi 10.2 Tokyo

Recent Profile Visitors

309 profile views
  1. Jacek Laskowski

    MMX 15 (Beta) Available

    Is it possible to transfer MMX settings between computers with different Delphi versions? How to do it? from Delphi 10.2 to Delphi 10.3 thanks
  2. Jacek Laskowski

    [FireDAC] Query.MergeDataset - how to use?

    How to correctly use the MergeDataset method from TFDQuery? I have FDQuery and FDMemTable, in FDMemTable I have data copied from FDQuery: FDMem.Data: = FDQuery.Data; ...then I modify the record in FDMemTable, and then I extract the differences to a separate FDMemTable: FDMemDelta.Data := FDMem.Delta; // <--- delta to data Finally, I want to save these changes (stored in FDMemDelta as data) to the database, so I do: FDQuery.MergeDataset(FDMemDelta, TFDMergeDataMode.dmDataMerge, TFDMergeMetaMode.mmNone); and in FDQuery I see changes ... but I do not know how to force FDQuery to write this changes to the database. FDQuery.Commit - does not save anything. How commit changes to DB?
  3. Jacek Laskowski

    [FireDAC] Access to the connection object using Connection Definition Name

    Ok, I know this solution, but I search for other, without TFDConnection, I use a FireDAC connection pooling.
  4. I use private connection definition configured by Connection Definition Name. FDQuery1.ConnectionName := 'Ora_Demo'; FDQuery1.Open('select * from "Customers"'); But now I need to assigned events on FDConnection level: Connection.OnRecover := ...; Connection.OnRestored := ...; Connection.OnLost := ...; How can I do this when I have only Query and the Connection is automatically created from the connection pool?
  5. Jacek Laskowski

    Delphi 10.3 Update 2 available

    Embarcadero http server is probably installed on Marco smartphone, and sometimes it happens that Marco is out of reach of the network 😉
  6. I read help topis about MergeDataMode options in Firedac datasets: http://docwiki.embarcadero.com/Libraries/Tokyo/en/FireDAC.Stan.Intf.TFDMergeDataMode How is difference between dmDeltaMerge and dmDataMerge?
  7. Jacek Laskowski

    DSharp problem

    I installed Spring4D in IDE, after this I installed DSharp packages. All without errors. Next I tried to compile some example applications from DSharp and I get error: [dcc32 Error] DSharp.ComponentModel.Composition.SpringContainer.pas(194): E2003 Undeclared identifier: 'Kernel' Please see on screen: What is the reason for the error? Spring4D with hotfix 1.2.3 DSharp from "spring-1.2.1" branch Delphi 10.2
  8. Jacek Laskowski

    Firedac and simultaneous connection to different version of Firebird

    I answer my question. Yes, it is possible to simultaneously connect to several versions of the same server. Here's the solution: http://docwiki.embarcadero.com/Libraries/Tokyo/en/FireDAC.Phys.TFDPhysDriverLink.DriverID
  9. Jacek Laskowski

    Firedac and simultaneous connection to different version of Firebird

    I tried to use the library from version 3 and for now it seems to work also for connections to the 2.5 server. But I have not written anything to the base yet, only readings. But is it safe and stable?
  10. Is it possible to connect to two versions of the Firebird server (2.5 and 3) at the same time using Firedac? Both connections should use a different version of fbclient.dll, how to do it?
  11. Jacek Laskowski

    Helper trick ;-)

    Yes, of course, I was joking.
  12. Jacek Laskowski

    Helper trick ;-)

    You destroy my day 😉
  13. Jacek Laskowski

    Helper trick ;-)

    As you know, helpers on the one hand are a neat solution, on the other hand they are only syntactic sugar. They have a lot of restrictions, including the lack of the possibility to add fields, but ... Today, when I was writing a helper I tried something like this: program Project1; {$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils; type MyInt = type Int64; MyIntHelper = record helper for MyInt private {$WRITEABLECONST ON} const fInitialized : Boolean = False; {$WRITEABLECONST OFF} protected procedure Initialize(); public function ToString(): string; end; procedure MyIntHelper.Initialize(); begin if not fInitialized then begin Self := 123456; fInitialized := True; end; end; function MyIntHelper.ToString(): string; begin Initialize; Result := IntToStr(self); end; var i : MyInt; begin try Writeln(i.ToString); Readln; except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; end. And it works 😉
  14. Jacek Laskowski

    Spring4D and objects life cycle

    I'm asking about Spring principles/rules. Because many instances of one of the classes are released by Spring and one of them is not released. I could not get to the cause.
  15. I have a class that does not have an interface, I register it and its factory in this way: TServiceLog = class; TServiceLogFactory = reference to function() : TServiceLog; Container.RegisterType<TServiceLog, TServiceLog>.PerResolve; Container.RegisterFactory<TServiceLogFactory>; pay attention to the use of PerRersolve, maybe it matters. Then I use this class in many other classes, as a parameter in the constructor, all object creation is done by Spring container: TFrameworkSMTPBus = class(TSMTPBus, IFrameworkBase, ISMTPBus) private fServiceLog: TServiceLog; public constructor Create(const aServiceLog: TServiceLog; const aSMTPClientFactory: TSMTPClientFactory); reintroduce; virtual; end; Are TServiceLog instances automatically released by Spring or should I release manually? It looks like it is released by Spring, but I have one case of memory leak, where after adding fServiceLog.Free leaked disappeared. And that's why I ask how it works underneath.