OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

BatchFile Does Not Shut Down HSQLDB Server
Goto page 1, 2  Next
 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base
View previous topic :: View next topic  
Author Message
retiredbob
General User
General User


Joined: 15 Apr 2010
Posts: 19

PostPosted: Thu Sep 09, 2010 11:46 am    Post subject: BatchFile Does Not Shut Down HSQLDB Server Reply with quote

I am using Windows XP, OpenOffice 3.2.1, and HSQL jar 2.0.

I've converted HSQLDB embedded so I can use either HSQLDB - Server or HSQLDB - File mode on a single computer.

I have followed the instructions in:

http://www.oooforum.org/forum/viewtopic.phtml?t=94068

I use the the suggested batch file to start up the Server. And after the database is opened in Server mode, the Server will shut down after a SQL SHUTDOWN COMPACT command is issued within the open database, as it is supposed to..

What seems to have no effect is the batch file provided in the instructions. I copied the batch file from the instructions. It is:

Stop_HSQLDB_Server.bat
Code:
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\openoffice\basis\program\classes\hsqldb.jar
"%javapath%" -jar "%jarpath%" --sql "shutdown compact;" localhost-sa
exit

Everything else in Server mode seems to work fine. Any ideas why the stop batch file doesn't? Does it even matter, since I can type in a Control C and "break" the startup batch file?

Thanks for any suggestions
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Thu Sep 09, 2010 4:33 pm    Post subject: Reply with quote

Did you change the paths as needed for OOo 3.2.1?

set jarpath=C:\Program Files\openoffice.org 3\basis\program\classes\hsqldb.jar

Or as needed for Windows 7 64-bit (in case others are reading this thread)?

set jarpath=C:\Program Files(32)\openoffice.org 3\basis\program\classes\hsqldb.jar

Don't worry about the space added between .org and 3 because the necessary quotes are added later in the batch.

------

And notice the following:

"%javapath%" -jar "%jarpath%" --sql "shutdown compact;" localhost-sa

The shutdown compact command is issued in the batch so you don't need to accomplish that step manually. And are you using the default 'sa' user name?

------

retiredbob wrote:
Does it even matter, since I can type in a Control C and "break" the startup batch file?

It doesn't matter in your case...that is if you issue the SHUTDOWN COMPACT command manually from Base before closing the startup batch window...then it's all the same.

Otherwise, it's safe (see note below) to simply kill the startup batch window with CTRL-C, but you'll be relying on the "abnormal shutdown recovery" automation next time you start HSQLDB. This recovery mechanism is extremely reliable, if not 100% reliable. In other words, HSQLDB does not corrupt it's own files. The only real danger is associated with a very limited amount of data loss directly associated with the WRITE_DELAY setting described below.

Note: HSQLDB 2.0 has a default WRITE_DELAY of 0.5 seconds (500 MILLIS); HSQLDB 1.8.x has a 10 (or 20 ?) second default delay. OOo overrides that default in the .script files with a 60 second WRITE_DELAY, so this will carry over to your file-mode and server-mode configurations when you migrate legacy data/files. You can change the WRITE_DELAY manually (and permanently) for your database. Otherwise, you must wait 10 seconds from the last database change/interaction before killing the HSQLDB server with CTRL-C.

------

Once you get this working, are you planning to use BatchLauncher.vbs as outlined in the tutorial to hide the startup batch window? In other words, were those instructions clear?
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'


Last edited by dacm on Thu Jun 07, 2012 4:58 pm; edited 2 times in total
Back to top
View user's profile Send private message
retiredbob
General User
General User


Joined: 15 Apr 2010
Posts: 19

PostPosted: Fri Sep 10, 2010 8:18 am    Post subject: Reply with quote

DACM,

I have tinkered quite a bit with the stop HSQLDB - Server batch file with no luck so far. By turning the echo off and adding a pause right before the batch file exited, the following showed up in DOS:

C:\Documents and Settings\Curt\Desktop>set javapath=C:\Program Files\Java\jre6\b
in\Java.exe

C:\Documents and Settings\Curt\Desktop>set jarpath=C:\Program Files\OpenOffice.o
rg 3\Basis\program\classes\hsqldb.jar "C:\Program Files\Java\jre6\bin\Java.exe "
-jar

C:\Documents and Settings\Curt\Desktop>"C:\Program Files\OpenOffice.org 3\Basis\
program\classes\hsqldb.jar "C:\Program Files\Java\jre6\bin\Java.exe " -jar " --s
ql "shutdown compact";
The filename, directory name, or volume label syntax is incorrect.

C:\Documents and Settings\Curt\Desktop>localhost-sa
'localhost-sa' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Curt\Desktop>pause exit
Press any key to continue . . .

You had written:

Did you change the paths as needed for OOo 3.2.1?

Yes, I had changed the paths.

And are you using the default 'sa' user name?

Yes, and I verified it was on the bottom line of the database.

BTW, HSQLDB 2.0 has a default WRITE_DELAY of 0.5 seconds (500 MILLIS); HSQLDB 1.8.x has a 20 second default delay. I think OOo overrides that default in the .script or .properties files even in your external HSQLDB file configuration. You can change the WRITE_DELAY manually (and permanently) for your database OR you should wait 10 seconds from the last database write to kill the HSQLDB server with CTRL-C.

I will change the Write Delay once I finish with the batch file issue.

Once you get this working, are you planning to use BatchLauncher.vbs as outlined in the tutorial to hide the startup batch window? In other words, were those instructions clear?

The instructions were clear. I did the minimal stumbling around until this stop batch file issue. At the moment, I am running both the startup and stop batch files from my Database directory, via shortcut keys on my desktop. This insures the Server's database files are housed in the same directory with the OpenOffice odb file making for an easier backup.

Hope you can identify my problem from the above. Thanks for you help.

retiredbob
Back to top
View user's profile Send private message
Greengiant224
OOo Enthusiast
OOo Enthusiast


Joined: 05 Jun 2010
Posts: 107
Location: All Over The World

PostPosted: Fri Sep 10, 2010 11:22 am    Post subject: Reply with quote

I have had the same problem for ages.There is a work around by using the "sqltool.rc" file
and that throws up problems under windows.

The only way to close down the server is by "CTRL+C" , after I may add closing all the databases first.
_________________
Greengiant 224

Linux 2.6.38, KDE 4.9.2, LibreOffice v 3.5.x (Java 1.6.35) utilising HSQL v1.8 & v2.3.0, MySQL, PostgreSQL, SQLite
+ Blood, Sweat and Tears (Application, Determination and Perseverance)
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Fri Sep 10, 2010 2:28 pm    Post subject: Reply with quote

Greengiant224 wrote:
using the "sqltool.rc" file

Yes this is a necessary file in the mix as I recall, but I'll have to look into folder placement of all components. Of course, the goal will be to put everything in a dedicated folder or perhaps subfolders for overall database management purposes. Currently, I use a separate folder for the hsqldb.jar, sqltool.rc, batch files, etc. It all works seamlessly for me including an automated startup of the HSQLDB server using the free PStart menu system, and all from a USB flash drive (using OOPortable 3.1.1). I've tested it extensively while watching Java.exe appear and disappear in the Windows task manager as I click the HSQLDB startup and shutdown icons in the PStart menu. In fact I use this setup every time I start Base 3.1.1, which is the only version I use normally. I'm using Windows 7 64-bit, but I don't think that makes any difference here. In fact, I've tested it thoroughly on Windows XP. I'll look back through everything this weekend and see if we can get this working for everyone (Windows users in particular due to these particular batch files), and I'll update the tutorial with the particulars of this sqltool.rc file as well.
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Fri Sep 10, 2010 2:45 pm    Post subject: Reply with quote

retiredbob wrote:
...the following showed up in DOS:

C:\Documents and Settings\Curt\Desktop>set javapath=C:\Program Files\Java\jre6\b
in\Java.exe

C:\Documents and Settings\Curt\Desktop>set jarpath=C:\Program Files\OpenOffice.o
rg 3\Basis\program\classes\hsqldb.jar "C:\Program Files\Java\jre6\bin\Java.exe "
-jar

C:\Documents and Settings\Curt\Desktop>"C:\Program Files\OpenOffice.org 3\Basis\
program\classes\hsqldb.jar "C:\Program Files\Java\jre6\bin\Java.exe " -jar " --s
ql "shutdown compact";
The filename, directory name, or volume label syntax is incorrect.

C:\Documents and Settings\Curt\Desktop>localhost-sa
'localhost-sa' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Curt\Desktop>pause exit
Press any key to continue . . .

Is this exact? Because I see some misplaced spaces and quotes that may throw things off. Could you post a copy of your current startup and shutdown batch files? One spot in particular, "shutdown compact"; should be "shutdown compact;" The semicolon is part of the SQL command.
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'
Back to top
View user's profile Send private message
retiredbob
General User
General User


Joined: 15 Apr 2010
Posts: 19

PostPosted: Fri Sep 10, 2010 3:33 pm    Post subject: Reply with quote

DACM asked:

Is this exact?
Because I see some misplaced spaces and quotes that may throw things off. Could you post a copy of your current startup and shutdown batch files? One spot in particular, "shutdown compact"; should be "shutdown compact;" The semicolon is part of the SQL command.

Sorry for leading you astray. That was one of the versions I was trying out. Here are the exact commands in the batch files along with a screen shot of the Stop HSQLServer.bat

START_HSQLDB_BAT
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\openoffice.org 3\basis\program\classes\hsqldb.jar
"%javapath%" -cp "%jarpath%" org.hsqldb.Server -database.0 file:mydb
exit

STOP_HSQLDB_BAT
@echo on
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\OpenOffice.org 3\Basis\program\classes\hsqldb.jar "%javapath%" -jar
"%jarpath%"--sql "shutdown compact;"
localhost-sa
pause exit


Screen Shot of Stop_HSQLDB.BAT with echo on and pause right before exit::

C:\Documents and Settings\Curt\My Documents\Bob's Documents>set javapath=C:\Prog
ram Files\Java\jre6\bin\Java.exe

C:\Documents and Settings\Curt\My Documents\Bob's Documents>set jarpath=C:\Progr
am Files\OpenOffice.org 3\Basis\program\classes\hsqldb.jar "C:\Program Files\Jav
a\jre6\bin\Java.exe " -jar

C:\Documents and Settings\Curt\My Documents\Bob's Documents>"C:\Program Files\Op
enOffice.org 3\Basis\program\classes\hsqldb.jar "C:\Program Files\Java\jre6\bin\
Java.exe " -jar "--sql "shutdown compact;"
The filename, directory name, or volume label syntax is incorrect.

C:\Documents and Settings\Curt\My Documents\Bob's Documents>localhost-sa
'localhost-sa' is not recognized as an internal or external command,
operable program or batch file.

C:\Documents and Settings\Curt\My Documents\Bob's Documents>pause exit
Press any key to continue . . .

In any event, changing semicolons, spaces, slash bars, etc. did not get the batch file working.

DACM also wrote: Currently, I use a separate folder for the hsqldb.jar, sqltool.rc, batch files, etc. It all works seamlessly for me including an automated startup of the HSQLDB server using the free PStart menu system,

I will look into doing that also and will report progress or lack thereof.

retiredbod
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Mon Sep 13, 2010 8:02 pm    Post subject: Reply with quote

Okay, thanks for your patience (it was a long weekend of chasing college football across the country). Let's take a look...

retiredbob wrote:
START_HSQLDB_BAT
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\openoffice.org 3\basis\program\classes\hsqldb.jar
"%javapath%" -cp "%jarpath%" org.hsqldb.Server -database.0 file:mydb
exit


Your START_HSQLDB_BAT looks good.

One option that's available when running HSQLDB in 'server mode' (plugin replacement for the same line above):
"%javapath%" -Xmx128m -cp "%jarpath%" org.hsqldb.Server -database.0 file:mydb

Adding (-Xmx128m) overrides the 64 MB default Java Virtual Machine (JVM) "heap" size. Use (-Xmx256m) to accommodate the "experimental HSQLDB cache" settings found here. The maximum setting can be up to ~80% of your free RAM (due to additional JVM overhead; see NOTE below). This "heap" settings can affect database performace and ultimately determines your maximum query-result size with HSQLDB 1.8 (and HSQLDB 2.x using default settings).

Your Java heap size also comes into play with MEMORY tables which must fit entirely into this JVM RAM allocation. MEMEORY (and CACHED) tables are persisted to disk after a short delay as determined by the WRITE_DELAY setting (normally 0.5 seconds), but the working copy remains in memory for maximum database performance. MEMORY tables are the default for new databases built with Base+HSQLDB in 'file' and 'server' modes (a split-file database). However, we change the default to CACHED tables when using the Quick Fix to avoid these memory allocation issues. If you have sufficient RAM on your host computer, stick with MEMORY tables while ensuring that your maximum JVM heap size is at least twice (technique) the size of your .script file (data is stored in the .script file for MEMORY tables; data is stored in the .data file for CACHED tables). You can change your default table-type in the database .properties file (HSQLDB 1.8 ) or .script file (HSQLDB 2.x), but that setting only affects newly created tables.

With CACHED tables only the cached portion is fit into JVM RAM to enhance performance. When creating a new database using the OpenOffice wizards, CACHED tables are the Base default, so your ported/migrated tables will be CACHED tables unless you specified otherwise. You can convert existing CACHED/MEMORY tables with a little effort.

So the 64 MB default JVM heap size is probably sufficient for CACHED tables in virtually all cases, unless you use 'outer join' queries with multi-megabyte tables. In any case, if you use CACHED tables you may want to adjust the various cache settings in the database .script or .properties file for the best performance -- especially with migrated databases.

NOTE: "Memory management in Java is a bit of a black art" so JVM "heap" settings will require some experimentation.

NOTE: If you're running a large database (1 GB or larger), keep in mind that Base is a 32-bit application requiring a 32-bit installation of Java for it's JDBC integration. That means the Java heap memory allocation is limited to the addressable (RAM) memory for a 32-bit application, which is 4GB (-Xmx4g). Again, the recommended Java heap size will be about 80% of 4GB (-Xmx3.3g). If you're also using a 32-bit operating system (without extensions), you'll be further limited because many other resources must utilize the 4GB address space, such as shared graphics card memory. See this article. With a 64-bit operating system and ample RAM (4GB+) you can still use Base to access larger databases that don't run comfortably within 32-bit Java heap limits (~3GB), but you'll need to use a 64-bit ODBC driver rather than a 32-bit JDBC driver to access the database.

Side-Note: while we're talking JVM RAM, the new HSQLDB 2.x engine generates disk-bound BLOB/CLOB tables while using simple pointers in the parent table's BLOB/CLOB column(s). This means you can query the parent table with no performance hit, while maintaining seamless access to huge, 64 TB BLOB/CLOB table (tested to 100 GB). And upon direct access, individual BLOB/CLOB data (video, etc.) will stream through limited JVM RAM for UPDATE or playback. In the meantime, your core database size (.data or .script file) can remain relatively small, perhaps fitting easily within the default 64 MB JVM heap size, especially when using CACHED tables.


Last edited by dacm on Sat Jun 30, 2012 10:34 am; edited 17 times in total
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Mon Sep 13, 2010 8:05 pm    Post subject: Reply with quote

retiredbob wrote:

STOP_HSQLDB_BAT
@echo on
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\OpenOffice.org 3\Basis\program\classes\hsqldb.jar "%javapath%" -jar
"%jarpath%"--sql "shutdown compact;"
localhost-sa
pause exit


Your STOP_HSQLDB_BAT shows some problems with line breaks. It should read:
Quote:
STOP_HSQLDB_1.8_BAT
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\OpenOffice.org 3\Basis\program\classes\hsqldb.jar

"%javapath%" -jar "%jarpath%" --sql "shutdown compact;" localhost-sa
REM pause
exit


And lets take a closer look at the options: Edit: added inline authentication options...
(1) With no password set, simply use (HSQLDB 1.8 only):
"%javapath%" -cp "%jarpath%" org.hsqldb.util.ShutdownServer
(2) With no password set, you may use (HSQLDB 2.0 approved)...(but see HSQLDB 2.0 specifics below):
"%javapath%" -jar "%jarpath%" --sql "shutdown;" --inlineRC url=jdbc:hsqldb:hsql://localhost,user=SA,password=
(3) With a password set (and 'sa' username), use the following to be prompted for the password: (HSQLDB 2.0 approved)
"%javapath%" -jar "%jarpath%" --sql "shutdown;" --inlineRC url=jdbc:hsqldb:hsql://localhost,user=SA
(4) When using an alias database name at startup, use the following to be prompted for the password: (HSQLDB 2.0 approved)
"%javapath%" -jar "%jarpath%" --sql "shutdown;" --inlineRC url=jdbc:hsqldb:hsql://localhost/mydb_alias,user=SA
(5) For fully automatic shutdown with password, requiring a secured sqltool.rc file (see the next post for details):
"%javapath%" -jar "%jarpath%" --sql "shutdown;" localhost-sa
(6) To add the COMPACT option to the shutdown sequence use:
"%javapath%" -jar "%jarpath%" --sql "shutdown compact;" localhost-sa

HSQLDB 2.0 has removed sqltool.jar from hsqldb.jar so you'll need to specify the path directly to sqltool.jar instead.
NOTE: The path below reflects the convention used by this HSQLDB 2.0 installer which includes sqltool.jar. Just make sure you remove any manually set Tools>Options>...>Classpath settings associated with HSQLDB to allow the default .ini file to work. And don't get too fancy if you're moving or renaming these installed files because sqltool.jar expects to find "hsqldb.jar" in the same folder (thanks Greengiant224)
NOTE: Plugins (2)-(6) above still apply after using the new jarpath below:
Quote:
STOP_HSQLDB_2.0_BAT
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\OpenOffice.org 3\Basis\program\classes\
hsqldb2\sqltool.jar
"%javapath%" -jar "%jarpath%" --sql "shutdown;" --inlineRC url=jdbc:hsqldb:hsql://localhost,user=SA,password=
REM pause
exit


Embarassed So I'll update the tutorial concerning Stop_HSQLDB_Server.bat !!!

Here's some background info on "closing" a database hosted by the HSQLDB server engine using sql SHUTDOWN vs SHUTDOWN COMPACT:
HSQLDB documentation wrote:
When SHUTDOWN is issued, all active transactions are rolled back. A special form of closing the database is via the SHUTDOWN COMPACT command. This command rewrites the .data file that contains the information stored in CACHED tables and compacts it to size. This command should be issued periodically, especially when lots of inserts, updates or deletes have been performed on the cached tables. Changes to the structure of the database, such as dropping or modifying populated CACHED tables or indexes also create large amounts of unused file space that can be reclaimed using this command.
------------------
"[SHUTDOWN COMPACT] takes longer than normal SHUTDOWN."
------------------
...SHUTDOWN COMPACT will reduce the space required and may improve access times...
------------------
The temporary file created at the time of a SHUTDOWN COMPACT can be equal in size to the .data file.

_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'


Last edited by dacm on Thu Oct 21, 2010 12:25 pm; edited 22 times in total
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Mon Sep 13, 2010 8:10 pm    Post subject: Reply with quote

With a database "password" set as in option (5) & (6) above, you'll need to incorporate the 'sqltool.rc' file found in your \hsqldb\sample\ folder. Actually, that's just an example of sqltool.rc.

I've simplified it to ( copy & paste to a new file named sqltool.rc )
Code:

urlid localhost-sa
url jdbc:hsqldb:hsql://localhost
username sa
password mydbpass

Of course, you'll need to specify your own username (note: 'sa' twice in the sqltool.rc file code above) and password or leave it blank for future use.

This sqltool.rc file must be located at the root of your profile (%USERPROFILE%) during the batch file processing.
For example, in Windows 7 the %USERPROFILE% variable used in a batch file yields the current user's folder:
C:\Users\dacm
That's not inherently secure, so you'll need to limit access to your Windows profile/logon in order to secure your database password.

Or, my own STOP_HSQLDB batch file copies this sqltool.rc file from an encrypted (TrueCrypt or see FreeOTFE) container to my %USERPROFILE% folder just before SHUTDOWN processing. Then immediately after processing, the very next line of my batch file uses sdelete.exe to securely wipe the file 7 times. In real-time, the sqltool.rc file scarcely flashes before it disapears from my profile folder during HSQLDB server shutdown.
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'


Last edited by dacm on Sun Oct 31, 2010 9:52 pm; edited 11 times in total
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Mon Sep 13, 2010 8:21 pm    Post subject: Reply with quote

So here's the single-folder solution...
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'


Last edited by dacm on Thu Oct 21, 2010 3:15 am; edited 1 time in total
Back to top
View user's profile Send private message
retiredbob
General User
General User


Joined: 15 Apr 2010
Posts: 19

PostPosted: Tue Sep 14, 2010 1:14 pm    Post subject: Reply with quote

Okay, DACM---

That did it for me. Option number 1 works and is my preference for a Shutdown Batch file:
"%javapath%" -cp "%jarpath%" org.hsqldb.util.ShutdownServer

lI very much appreciate your efforts on dissolving what was for me an irksome issue as well as your advising about write delays, .memory overrides, etc.

Also, I did take a look at your method of seamlessly opening up the HSQLDB Server and closing it down. I have decided not to use it since I am a casual user of databases and it would be overkill for how I work.

And lastly, I hope your teams won this past weekend.

retiredbob
.
Back to top
View user's profile Send private message
dacm
Super User
Super User


Joined: 07 Jan 2010
Posts: 769

PostPosted: Tue Sep 14, 2010 7:54 pm    Post subject: Reply with quote

retiredbob,

Congratulations! So you've successfully migrated an existing Base database to "file: mode," then upgraded to HSQLDB 2.0, and tamed "server-mode."

And I'm glad you asked because it uncovered the flaws in the "server-mode" tutorial; it was over-simplified and did not include the necessary server shutdown options. So thank you.

And yes, OU won their game!
_________________
Soli Deo gloria
Tutorial: avoiding data loss with Base + Splitting 'Embedded databases'
Back to top
View user's profile Send private message
peterdines
General User
General User


Joined: 18 Feb 2009
Posts: 20

PostPosted: Wed Sep 15, 2010 6:38 am    Post subject: Reply with quote

Great thread! I was having trouble with this myself.

Now, has anyone gotten this type of thing to work successfully in Windows by running it as a shutdown script? (you can specify shutdown scripts in gpedit.msc)

I've tried but it doesn't seem to do anything useful. I suspect the JVM is already terminated by the time the script gets to run, because the lock file is still there when I reboot.
Back to top
View user's profile Send private message
Greengiant224
OOo Enthusiast
OOo Enthusiast


Joined: 05 Jun 2010
Posts: 107
Location: All Over The World

PostPosted: Mon Oct 18, 2010 4:48 am    Post subject: Reply with quote

Hi All,
Has anybody had a problem in shutting down hsqldb v2.0 trying to use this batch file?

DACM replied in an earlier posting to this thread.

Quote:

STOP_HSQLDB_BAT
@echo off
set javapath=C:\Program Files\Java\jre6\bin\Java.exe
set jarpath=C:\Program Files\OpenOffice.org 3\Basis\program\classes\hsqldb.jar
"%javapath%" -jar "%jarpath%"--sql "shutdown compact;" localhost-sa
REM pause
exit


From my searching I have concluded that hsqldb.jar version 1.8 (and all previous versions) incorporated the sqltool, which in the above batch terminates the correct shutdown.

From hsqldb.jar version 2.0 this has been removed and, is now a separate 'tool' included in the folder /lib/sqltool.jar alongside hsqldb.jar

Using the above batch file (on windows) with hsqldb.jar version 2.0 it fails.
and reports java cannot find the 'org.hsqldb.jdbcDriver'.

The only way is to terminate the running server with "CTRL+C" after I may add you have shutdown the OOo base front end.

I have tried all various known ways of finding a work around, to no avail.
perhaps fredt (of hsqldb fame) could reverse this in a future release.

Note: I run hsqldb in server mode for several hours a day and when finished with,shut it down.
_________________
Greengiant 224

Linux 2.6.38, KDE 4.9.2, LibreOffice v 3.5.x (Java 1.6.35) utilising HSQL v1.8 & v2.3.0, MySQL, PostgreSQL, SQLite
+ Blood, Sweat and Tears (Application, Determination and Perseverance)
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Base All times are GMT - 8 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group