Jump to content

Lars Fosdal

Administrators
  • Content Count

    3416
  • Joined

  • Last visited

  • Days Won

    113

Everything posted by Lars Fosdal

  1. Lars Fosdal

    Spelling and search

    In the Web UI, search is upper right on the white bar.
  2. Lars Fosdal

    Recursive anonymous functions

    You should read this post
  3. Lars Fosdal

    10.3.1 has been released

    So, let's just rename it to Insight Errors...
  4. Lars Fosdal

    Best site/source for SQL Server questions?

    Well, I've added that where it seems safe for the viewers, but it is a short way between being a viewer and being a requestor, so for certain lookups, the data needs to be accurate. The entire allocation part is a very heavy SQL statement with joins, functions, conditions and sorting - and the actual grabbing is totally void of transactions.
  5. Lars Fosdal

    10.3.1 has been released

    It really annoys me that they didn't adapt Error Insight for inline declared variables. So ugly!
  6. Lars Fosdal

    10.3.1 has been released

    Every time this happens to me, there are duplicate source files on different paths. I believe I am editing ./myproject/thisversion/myfile.pas, while I actually am in ./myproject/thatversion/myfile .pas Sometimes this happens because I used find in files on the wrong path, or a file was included in the project from the wrong path.
  7. I use MWSR queues for stuff like logging. Multiple threads queue things for logging, and a single log thread does the actual work. Basically, it is a useable model for any kind of data that in the end needs to be serialized to storage.
  8. It is waste if you spend time continuously fixing the same broken code, instead of buying or rebuilding something that can replace it and reduce "daily" maintenance chores?
  9. I am not sure that I am buying Joel's TCP analogy. It doesn't guarantee arrival, but it does guarantee that you as a sender will know if it arrived or not.
  10. Lars Fosdal

    Ole DB (Ado) for MSSQL un-deprecated by Microsoft

    Added updated code example for how to prioritize specific MSSQL connection types on a machine that may have multiple installed.
  11. Non-implementation detail = the interface declaration - i.e. the black box UI - the what. Implementation detail = how an interface has been implemented - i.e. the inside of black box - the how. You want to use the first, and avoid relying on details from the second.
  12. Lars Fosdal

    Unreliable connection to remote MS SQL Server database

    FYI, @Martyn Spencer, it seems that the new MSOLEDBSQL drivers are as fast as SQLNCLI. See other thread above for how to select a specific driver.
  13. Lars Fosdal

    Ole DB (Ado) for MSSQL un-deprecated by Microsoft

    EMBT placed the above constants in the implementation section of the FireDAC.Phys.MSSQL, which I guess is good for hiding implementation details, but not so good for doing overrides... hello, new literal. Initial benchmarks indicate that C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER' is about the same speed as SQLNCLI 11, which is good news. class function TPSDFireDatabasePoolMSSQL.FindBestDriver(const Link: TFDPhysMSSQLDriverLink): String; const // Constants copied from implementation section of FireDAC.Phys.MSSQL C_2017_ODBC = 'ODBC DRIVER 17 FOR SQL SERVER'; C_2016_ODBC = 'ODBC DRIVER 13 FOR SQL SERVER'; C_2012_ODBC = 'ODBC DRIVER 11 FOR SQL SERVER'; {$IFDEF POSIX} C_FreeTDS = 'FreeTDS'; {$ENDIF} {$IFDEF MSWINDOWS} C_2012_NC = 'SQL SERVER NATIVE CLIENT 11.0'; {$ENDIF} var DriverList TStringList; WantedList : TArray<String>; begin Result := ''; WantedList := {$IFDEF MSWINDOWS} [C_2017_ODBC, C_2016_ODBC, C_2012_NC, C_2012_ODBC] {$ENDIF} {$IFDEF POSIX} [C_2017_ODBC, C_2016_ODBC, C_2012_ODBC, C_FreeTDS] {$ENDIF}; DriverList := TStringList.Create; try Link.GetDrivers(DriverList); for var Wanted in WantedList do for var Driver in DriverList do if CompareText(Wanted , Driver) = 0 then Exit(Wanted); finally DriverList.Free; end; end; class function TPSDFireDatabasePoolMSSQL.CreateDriverLink(const aOwner: TComponent): TFDPhysDriverLink; var Res: TFDPhysMSSQLDriverLink; begin Res := TFDPhysMSSQLDriverLink.Create(aOwner); Res.ODBCDriver := FindBestDriver(Res); Result := Res; end;
  14. Lars Fosdal

    Ole DB (Ado) for MSSQL un-deprecated by Microsoft

    Oddly enough, FireDAC seems to prefer SQLNCLI over everything else, and I can't find a way to override that priority, apart from explicitly setting the ODBCDriver on Create, which makes it harder to handle it not being installed procedure TFDPhysMSSQLDriver.InternalLoad; begin inherited InternalLoad; if ODBCDriver = '' then ODBCDriver := FindBestDriver( {$IFDEF MSWINDOWS} [C_2012_NC, C_2016_ODBC, C_2012_ODBC, C_2017_ODBC, C_2008, C_2005, C_2000] {$ENDIF} {$IFDEF POSIX} [C_2016_ODBC, C_2012_ODBC, C_2017_ODBC, C_FreeTDS], C_FreeTDSLib {$ENDIF} ); end;
  15. Lars Fosdal

    Unreliable connection to remote MS SQL Server database

    Somewhat related: SQLNCLI is deprecated. MSOLEDBSQL is the new best practice. As for unreliable connections - some servers disconnects pretty quick, so we have a wrapper that handles this and reconnects as required.
  16. Is there a cross-platform version of IsDebuggerPresent? I want to disable some of my automatic maintenance threads when the app is running under a debugger, now also for a FireMonkey app.
  17. Lars Fosdal

    TIdSSLIOHandlerSocketOpenSSL and TLS 1.3 ?

    https://stackoverflow.com/questions/50481630/upgrade-indy-library-to-use-latest-openssl-library The answer is still "no".
  18. Lars Fosdal

    Hands-On Design Patterns with Delphi

    Ordered print + epub version.
  19. My guess: The SetPosition / Seek ends up with an out of bounds address?
  20. I still prefer using regular constants for bit-fiddling.
  21. Lars Fosdal

    Ole DB (Ado) for MSSQL un-deprecated by Microsoft

    Interesting. Has anyone done any benchmarking of the MSOLEDBSQL driver vs the SQLNCLI driver?
  22. Lars Fosdal

    Rapid generics

    Interesting. Does Rapid function properly with RTTI as well?
  23. Just curious: Has anyone seen a valid use case for defined ordinal values in enumerations?
  24. That is the "weird" right there. Definitively a good reason to avoid defined ordinal values in enumerations.
  25. Isn't there something weird about RTTI for enums that have manually set ordinal values as well?
×