Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 12/04/22 in all areas

  1. Attila Kovacs

    How do I delete a row in a database with FireDAC?

    not buying every hdd's on the earth? 😉
  2. Lars Fosdal

    How do I delete a row in a database with FireDAC?

    A common way to deal with unique identities in a database is to use an auto-incremented identity field. SQLite has an autoincrement feature PostgreSQL calls it a Serial MSSQL names the feature Identity, although they also have a synonymous auto-increment feature MySQL and MariaDB call it an Auto_Increment Basically, it is an automatically incremented integer value which uniquely identifies the row, without having any other relation to the data in the row. You use these identity fields as primary keys for efficiently joining tables, and as unique id's for doing updates and deletions. SELECT * FROM t_parent LEFT JOIN t_child ON t_child.parentid = t_parent.id Pitfall - it is not advisable to use these keys as part of a URL - since it allows for fishing for content by variating the id. If you need to expose the row identity as part of a URL, it is better - although more costly with regards to space - to have a second field in the form of a unique GUID.
  3. David Heffernan

    Create multiple instances of tApplication with multiple MainThreads?

    Yes. But of course you need to define what thread safe actually means in this context. It's a very general term. For win32 the threading model is that all operations on a window must be performed in the thread that created the window. Queued messages for that window are delivered to the meesage queue of that thread. Nonqueued messages are synchronised onto that thread. This is not a free for all thread safety where you can do anything you want from any thread. This is why the term thread safety is often not useful. It's more useful to describe and summarise the threading model. In this case I always say that windows have thread affinity.
  4. David Heffernan

    Create multiple instances of tApplication with multiple MainThreads?

    This isn't really true. You can have multiple threads that serve multiple windows with different message loops. Windows supports that. What you can't do is do that in vcl.
×