Share

HyperSQL Database Engine

Tracker: Bugs

5 Using database as file, no exception for unwritable file. - ID: 1835060
Last Update: Comment added ( fredt )

I am attempting to validate that the choise the user does, when selecting
the database output file, is valid.

So for

server.setDatabasePath(0, "a:/mydb.db");

hsqldb does indeed prints to stderr:

[Server@29428e]: [Thread[HSQLDB Server @29428e,6,main]]: Database
[index=0db=file:a:/mydb.db, alias=shiponline] did not open:
org.hsqldb.HsqlException: The database is already in use by another
process: org.hsqldb.persist.NIOLockFile@1f06edd4[file =A:\mydb.db.lck,
exists=false, locked=false, valid=false, fl =null]:
java.io.FileNotFoundException: A:\mydb.db.lck (The system cannot find the
path specified)
[Server@29428e]: [Thread[HSQLDB Server @29428e,6,main]]: Shutting down
because there are no open databases

However no RuntimeException is thrown, and I seem not to be able to detect
this condition and warn the user.


Iulian Virtejanu ( viulian ) - 2007-11-20 10:40

5

Closed

Wont Fix

Fred Toussi

engine

current-release

Public


Comments ( 2 )

Date: 2007-11-22 23:25
Sender: fredtProject Admin


Good you found a solution for your requirement.


Date: 2007-11-21 06:50
Sender: viulian


I was able to find a workaround, by using:

server.start();
if ("SHUTDOWN".equals(server.getStateDescriptor()))
{
// trhow exception here.
}


Attached File

No Files Currently Attached

Changes ( 4 )

Field Old Value Date By
status_id Open 2007-11-22 23:25 fredt
resolution_id None 2007-11-22 23:25 fredt
assigned_to nobody 2007-11-22 23:25 fredt
close_date - 2007-11-22 23:25 fredt