Villeroy wrote:...you must not manipulate a document's zip-archive while the document is loaded in the office suite. I tried to disconnect, save, close, manipulate and then re-open the document but that leads to even more crashes, incomplete results, incomprehensible error messages and so on.
Greengiant224 wrote:...using single-user file-mode you cannot make a backup whilst the *.odb file is open.
What's the common issue here? Are these errors and limitations associated with "disconnecting" the .odb document from HSQLDB reliably?
If that's the problem then I presume we can force the disconnect by shutting down HSQLDB through SQL (in either mode: file or server). That's really a back-end function anyway. Can't we simply issue "SHUTDOWN" in the macro and wait? The code could then check the connection status at 1 second intervals up to a reasonable limit. That limit could be as low as 5 seconds or so based on a shutdown rate of 200,000 rows per second -- as tested on my 7 year old, dual-core computer. SHUTDOWN COMPACT adds an order of magnitude to the time, so 200K rows take more like 10 seconds to process. If we don't get confirmation of a shutdown with disconnect in a reasonable time-frame, then simply abort and exit (or ask the user if they want to wait for million+ record databases).
Otherwise, if these issues are unrelated to database connection, then where are the specific problems? I ask, because starting with an unconnected file (before clicking the Tables icon or opening any queries, forms or reports), I've never seen an issue with extracting an embedded database and/or driver from sub-storage using portable FreeHSQLDB code. I've run several hundred tests, extracting drivers and databases from the running "host" .odb without issue while bypassing the FreeHSQLDB dialog. By "host" .odb I'm referring to an .odb with embedded FreeHSQLDB library. I've also run quite a few tests using the FreeHSQLDB dialog from a "host" .odb to extract an embedded database from a separate, unopened .odb in side-saddle mode. By "side-saddle mode" I'm referring to FreeHSQLDB residing and run within in a "host" .odb, but using the FreeHSQLDB dialog to select a separate, legacy, 'embedded database' file for database extraction. I've had no issues with this side-saddling approach either, perhaps because the separate .odb isn't open in Base. Am I missing something here?
Edit: Oh, I wasn't actually connecting to the files extracted from a legacy 'embedded database' after using the "host" in side-saddle mode. It seems that Basic's 'Name OldName As NewName' facility can't rename those particular files (script, properties, data, backup) as necessary for JDBC connection, apparently due to the lack of a dot or file-extension. Unless they're renamed with at least a dot (.script), JDBC ignores them. So unless there's another facility to rename those files, I'm stuck with manual intervention to rename files extracted from a legacy 'embedded database' file. Bummer. |
Now, I did run into problems while attempting to inject the FreeHSQLDB library itself into another .odb. That's proven hit or miss, but so far I haven't tried it after unloading the library in the "host" .odb.
Or were the issues primarily a matter of re-packing the "host" .odb with an external database and driver? Before or after database connection? I haven't tested re-packing at all because the portable FreeHSQLDB code did not support re-packaging.