I am using HSQLDB filebased database version 2.5.0 in multi threaded java environment wherein many projects can read/write/update the 2 tables in single database. We observed that, few minutes after starting the projects, the .script file holding the data gets deleted automatically & the data is getting erased. Following is the configuration,
Properties props = new Properties();
props.put("user", userName);
props.put("password", password);
props.put("jdbc.strict_md", "false");
props.put("jdbc.get_column_name", getColumnName);
props.put("shutdown", "true");
props.put("hsqldb.write_delay_millis", "0");
props.put("hsqldb.tx", "MVCC");
connection = DriverManager.getConnection("jdbc:hsqldb:file:" + instantURL + databaseName, props);
The username,password,instanceURL,database are just the placeholders & are read from properties file in environment. Can anybody please suggests, if somethings looks not okay here or needs some change in configuration ? Feel free to ask in case more information is required ? Thank you.
The in-process file: database cannot be used in a situation where "many projects can read/write/update the 2 tables in single database" if the projects are separate processes.
If the projects are all in the same process, then this form of access is allowed. It is better to avoid ("shutdown", "true")
You can configure and start an HSQLDB Server for scenarios: http://hsqldb.org/doc/2.0/guide/listeners-chapt.html