where is my data file

Sep 15, 2009 at 5:13 AM

I used the file persistent sample code, I can see:

foo.log, foo.properties, foo.script and foo.data

foo.data only contains 20 bytes (all zero)

Coordinator
Oct 2, 2009 at 1:27 AM
Edited Oct 2, 2009 at 1:31 AM

Hi, I'm very sorry. forgot to look at discussion section. I should enable email notification.

You need to call "SHUTDOWN" (SQL statement) at the end of the application to flush all data to data file (foo.data). Otherwise data get flushed periodically. But as that application is short lived, that flush may never happen.

But your data is not lost... everything is in transaction log (foo.log)... when you restart database next time, it will process the transaction log and data will get recovered.

That is for "Cached" tables... for memory tables when you call shutdown all data creation statements (INSERT) are get written to foo.script file. foo.data file is not touched.

Please refer to following HSQL documentation http://hsqldb.org/doc/guide/ch01.html

that 20 bytes you see are control information (or place holders) ... anyway we are changing the Database Engine to a newer version and not fixing anything on the current one.

 

 

 

 

Coordinator
Oct 4, 2009 at 6:52 AM

Now we automatically shutdown the database ( only for file bases databases) when DboConnection closes.