I'd like to submit this patch which finishes my earlier additions to DatabaseEventListener. Now, while running a query, DatabaseEventListener.setProgress is called periodically to indicate how many rows have been handled so far. There's a new state called STATE_STATEMENT_PROGRESS.
I've been testing this thoroughly with some large databases (e.g. 5 Gigabytes), and with a GUI that uses the DatabaseEventListener to show progress. It now allows me to accurately inform the user of the progress being made in long-running queries.
I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the H2 License, version 1.0, and under the Eclipse Public License, version 1.0 (http://h2database.com/html/license.html).
I also tried adding a similar notification to DDL commands such as DROP TABLE, but alas, I failed to find a way that didn't involve making significant changes to H2 code.
Regards,
Steve
---------------------------------------------------
Steve McLeod
Founder, Poker Copilot