Thank you for your answer, I will use for now on the AUTO_SERVER mode.
I wrote a quick class to show the initial problem. The class will open
the file in SERIALIZED mode and run a select query every second and
will print the time taken by the executeQuery method. The output looks
like this:
9:22:14 AM Database last modified: 9:22:14 AM
9:22:14 AM Select query: 31
9:22:15 AM Database last modified: 9:22:14 AM
9:22:15 AM Select query: 0
9:22:16 AM Select query: 0
9:22:17 AM Select query: 0
/*...*/
Now I open a H2 shell:
C:\Eclipse\bug h2>java -cp *.jar org.h2.tools.Shell -url
"jdbc:h2:test;FILE_LOCK=SERIALIZED" -user sa
As soon as I run this command, the java program outputs something like :
9:25:10 AM Database last modified: 9:25:10 AM
9:25:10 AM Select query: 1032
9:25:12 AM Database last modified: 9:25:11 AM
9:25:12 AM Select query: 0
9:25:13 AM Select query: 0
If in the shell, I run "select * from tableB;", you will also see an
initial delay in the java output.
Let me know if you have any questions.
Sylvain
I have now implemented an experimental feature so that the database
file is only modified if there is anything to roll back, or when
writing. To test it, you need to use the trunk, and set the system
property "h2.modifyOnWrite". I didn't test it together with serialized
file locking yet. But it should speed up the serialized file lock.
This is committed in the trunk now.
Regards,
Thomas