Search found 753 matches

by aehimself
30.03.2019, 21:46
Forum: ZeosLib 7.2 Forum
Topic: ZQuery.Delete and ZQuery.Eof
Replies: 0
Views: 987

ZQuery.Delete and ZQuery.Eof

Hi all, I did my research and I know that this is not a bug in Zeos, but it Delphi's way of handling datasets but it's quite annoying and easy to fix. You are scrolling through a dataset, deleting some records on the way: While Not ZQuery.Eof Do If somecondition then ZQuery.Delete Else ZQuery.Next; ...
by aehimself
15.03.2019, 11:26
Forum: ZeosLib 7.2 Forum
Topic: Using IN on ZQuery.Filter
Replies: 3
Views: 653

Re: Using IN on ZQuery.Filter

The original link is available again, but I suppose it has a better place published. Thank @mdaems (and whoever sent it to him) for the document though :)
by aehimself
13.03.2019, 19:51
Forum: ZeosLib 7.2 Forum
Topic: Is there any additional configuration for ZeosLib 7.2.4 to optimize MySQL performance?
Replies: 18
Views: 3322

Re: Is there any additional configuration for ZeosLib 7.2.4 to optimize MySQL performance?

Kind of a long shot, but worth a try. When I had "performance issues" (a specific data processing task took 500 ms which I found unacceptable :) ) my solution was to put the whole thing in a single transaction: Try sqlconnection.StartTransaction; TheveryLongProcedureWithLotsOfUpdates; sqlc...
by aehimself
13.03.2019, 17:42
Forum: ZeosLib 7.2 Forum
Topic: Formless application shutdown delay
Replies: 5
Views: 884

Re: Formless application shutdown delay

Well, I was already trying to find the solution for a day when I decided to ask the community. Had a feeling that this is not a trivial issue so if I'd like to get a solution I must go into details. The rest is just the typical case of the rubber duck debugging, managed to pinpoint the weak link as ...
by aehimself
13.03.2019, 17:32
Forum: ZeosLib 7.2 Forum
Topic: Using IN on ZQuery.Filter
Replies: 3
Views: 653

Re: Using IN on ZQuery.Filter

In this forum post there used to be a link to a PDF document called zExpression.pdf. It's a really nice one describing what you can do with the .Filter property. Unfortunately the link is not valid anymore (says 404 for me) but I managed to grab it for myself before it disappeared so I'll just reupl...
by aehimself
03.03.2019, 21:23
Forum: ZeosLib 7.2 Forum
Topic: Formless application shutdown delay
Replies: 5
Views: 884

Re: Formless application shutdown delay

And my assumption was more than correct. It's a pain in the back to download the latest version of libmysql.dll from Oracle: - Download the web installer, then select Other, select Connectors / C, 64 bit (it can not install both at the same time... :lol:) - Next-Next-Finish, and then go to C:\Progr...
by aehimself
03.03.2019, 21:02
Forum: ZeosLib 7.2 Forum
Topic: Formless application shutdown delay
Replies: 5
Views: 884

Re: Formless application shutdown delay

So I made some logging with Process Monitor when the delay occurs and found some really interesting things: dcdelay.PNG At 20:39:52 the worker thread (with Thread ID 10920, confirmed by checking on Delphi's side during the test) terminates. In theory the connection is already closed and the componen...
by aehimself
03.03.2019, 19:30
Forum: ZeosLib 7.2 Forum
Topic: Formless application shutdown delay
Replies: 5
Views: 884

Re: Formless application shutdown delay

Test application: program Project1; {$APPTYPE CONSOLE} uses System.SysUtils, ZConnection, Classes; Type TWorkerThread = Class(TThread) strict private _sqlconnection: TZConnection; public Constructor Create; Reintroduce; Destructor Destroy; Override; Procedure Execute; Override; End; Var wt: TWorkerT...
by aehimself
03.03.2019, 09:59
Forum: ZeosLib 7.2 Forum
Topic: Formless application shutdown delay
Replies: 5
Views: 884

Formless application shutdown delay

Hello, I am experiencing a very strange issue. I have a formless (console) Delphi application with several worker threads. Each worker thread is creating a TZConnection in the constructor and calls the .Connect in the onExecute cycle if it is not connected. Destruction it is closing all tables, disc...
by aehimself
08.12.2018, 20:31
Forum: ZeosLib 7.2 Forum
Topic: Zeos 7.2.4 64bit issue
Replies: 1
Views: 1338

Re: Zeos 7.2.4 64bit issue

NEVER MIND.

My 64-bit MySQL installation contained a 32-bit libmysql.dll. Try to get your head around that...

I hunted a 64-bit version from the internetz and my 64-bit apps started to work immediately.
by aehimself
08.12.2018, 20:16
Forum: ZeosLib 7.2 Forum
Topic: Zeos 7.2.4 64bit issue
Replies: 1
Views: 1338

Zeos 7.2.4 64bit issue

Good day, I recently tried to build one of my applications to a 64 bit Windows platform target (using Delphi 10.2). The build succeeds, but I can not connect to the MySQL server because of different reasons. I put the 32-bit libmysqld.dll in C:\Windows\SysWOW64 and the 64-bit one in C:\Windows. Both...
by aehimself
25.11.2018, 16:12
Forum: ZeosLib 7.2 Forum
Topic: Multithreaded application best practices
Replies: 14
Views: 2612

Re: Multithreaded application best practices

Yep, as far as I can see both Fr0st's and Stinkard's practices are the same. Considering the importance I guess we could say this is an other golden rule. - 1 thread = 1 database connection - Think on explicit table usage for threads if possible. If not, use a locking mechanism (in DB or in app leve...
by aehimself
22.11.2018, 21:36
Forum: ZeosLib 7.2 Forum
Topic: Multithreaded application best practices
Replies: 14
Views: 2612

Re: Multithreaded application best practices

@ Fr0sT, thank you for the clarification; that's how I imagined would be safe. @ Stinkard; that's the best setup I can think of considering thread safety and processing speed. If you keep your data in chunks (object, arrays) one thread can pick one, do it's job and load the results in the database. ...
by aehimself
21.11.2018, 12:34
Forum: ZeosLib 7.2 Forum
Topic: How can I check if connection is active?
Replies: 7
Views: 2535

Re: How can I check if connection is active?

Moreover this dummy select consumes more resources (starts/uses a transaction, creates resultset etc) than probably other driver-specific pinging methods. F.ex., FB pings by requesting DB info which doesn't require transaction and creating a resultset. This. I wish I'd have this knowledge about all...
by aehimself
21.11.2018, 12:21
Forum: ZeosLib 7.2 Forum
Topic: Multithreaded application best practices
Replies: 14
Views: 2612

Re: Multithreaded application best practices

I got a similar idea yesterday and started working on mapping specific tables explicitly to specific threads. We'll see if I can change the business logic to allow this at the end. Just keep in mind that even simultaneous access to two different tables is not safe if they belong to the same connecti...