Page 1 of 1

[Solved] Server mode creates new DB

Posted: Wed Apr 23, 2014 9:40 pm
by AndyBlubaugh
Hello everyone,

I've recently started using a split database in server mode. It took about a year to get up and running, but it finally worked! For a week or so, anyway.

Now, when I try to connect, I connect to a database called "test", rather than my database, called "mydb". I don't remember ever making a database called "test", and even if I trash all of the files associated with "test", the next time I try to start up the database, it RE-CREATES this database called "test".

This situation occurred a few weeks ago, in an earlier phase of testing the server behaviors of the database, but the behavior stopped once I deleted a document called server.properties that another I had created based on another forum user's suggestion. You can see the dialogue about this issue here: viewtopic.php?t=67020

Now it's happening again: the same command I have always typed into the terminal is causing a brand new database to be created and opened, called "test", and I can't make it stop.

I start by typing in this command at the terminal:

Code: Select all

java -cp /__Dedicated/hsqldb.jar org.hsqldb.server.Server
I get the following response.

Code: Select all

[Server@746ac18c]: [Thread[main,5,main]]: checkRunning(false) entered
[Server@746ac18c]: [Thread[main,5,main]]: checkRunning(false) exited
[Server@746ac18c]: Startup sequence initiated from main() method
[Server@746ac18c]: Could not load properties from file
[Server@746ac18c]: Using cli/default properties only
[Server@746ac18c]: Initiating startup sequence...
[Server@746ac18c]: Server socket opened successfully in 10 ms.
[Server@746ac18c]: Database [index=0, id=0, db=file:test, alias=] opened sucessfully in 782 ms.
[Server@746ac18c]: Startup sequence completed in 804 ms.
[Server@746ac18c]: 2014-04-23 12:26:37.325 HSQLDB server 2.3.0 is online on port 9001
[Server@746ac18c]: To close normally, connect and execute SHUTDOWN SQL
[Server@746ac18c]: From command line, use [Ctrl]+[C] to abort abruptly
I am attaching screen shots of the file structure before I try starting the engine, and after, so that you can see all the files that are automatically created. Any advice would be much appreciated.

Thank you all in advance!

Re: Server mode creates new DB

Posted: Wed Apr 23, 2014 9:55 pm
by DACM
AndyBlubaugh wrote:...the same command I have always typed into the terminal is causing...
DACM wrote:
So your final startup string would be something like (while substituting your Java path and your Jar path to hsqldb.jar):
  • "%javapath%" -cp "%jarpath%" org.hsqldb.server.Server -database.0 file:mydb;hsqldb.default_table_type=cached
In your particular case:
  • Code: Select all

    java -cp /__Dedicated/hsqldb.jar org.hsqldb.server.Server -database.0 file:mydb;hsqldb.default_table_type=cached
Actually, you can eliminate the property: ;hsqldb.default_table_type=cached since this is picked-up by the mydb.script file as a default: SET DATABASE DEFAULT TABLE TYPE CACHED

So the following will suffice in your case:
  • Code: Select all

    java -cp /__Dedicated/hsqldb.jar org.hsqldb.server.Server -database.0 file:mydb

Re: Server mode creates new DB

Posted: Wed Apr 23, 2014 10:13 pm
by AndyBlubaugh
Goodness, such a silly mistake. I actually caught it myself about a second before this response showed up. Thanks again DACM!

Re: Server mode creates new DB

Posted: Wed Apr 23, 2014 10:19 pm
by DACM
AndyBlubaugh wrote:...such a silly mistake.
Well, this syntax is rather complex, so it's best to create a standing shell-script file containing this start-up string, so you don't have to type it each time. And you'll need another shell-script file to shutdown the database, unless you utilize SQL (SHUTDOWN or SHUTDOWN COMPACT) from the Tools > SQL console (or from a push button macro) in Base.

In any case, you should issue CHECKPOINT or CHECKPOINT DEFRAG daily on your running database, perhaps using a push-button on a Form, as previously mentioned.
...