Jump to content

Hans J. Ellingsgaard

Members
  • Content Count

    101
  • Joined

  • Last visited

Posts posted by Hans J. Ellingsgaard


  1. If you use the StartTransaction command, you have to finish it off with CommitTransacton or a  Rollback. If you're not using a StartTransaction, the FDConnection will start it for you and make a commit when your datasets are closed.


  2. Your problem might have something to do with nested transactions. If your db or your odbc driver don't support nested transactons, make shure there is no ongoing transaction on the same connectionm, before you call StartTransaction.

     

    Something like this:

        if FDConnection1.InTransaction then
           FDConnection1.Commit;
     

        FDConnection1.StartTransaction;


  3. If you make a select count query on an indexed field, it should only take a ms to execute. The resultset will only have one record. 

    If your table only have 1500 records, the dataset.RecordCount should also respond quckly (not as quick as the record count thoug). 

    There must be something else that goes wrong.

     

    What database are you using?

    Have you tried to run the queries directly in a db manager?


  4. 8 hours ago, pieomy00 said:

    try       BitmapListAnimation1.AnimationBitmap.LoadFromFile(MyFile);     finally     end;

    I'm no expert in threads, but I'm shure that a LoadFromFile should be synchronized. As stated above the try/finally is pointless. 

     

    If you only have these two commands in the thread, and both will be synchronized, there will be no point in putting them in a thread. It will probably just slow your program down.


  5. 3 hours ago, Mark Williams said:

    They don't have to be. But with large amounts of data it I find it is much faster to load the data from a local file and refresh it from the server in the background

    But you would get rid of all the trouble of sync‘ing the data, if you kept the data on the server.

    With a REST service you will probably be able to load the data much faster, and save a lot of bandwith - at least if you are on a slow network.

    • Like 1
×