kashipai / h2database

H2 Database for reference.
0 stars 0 forks source link

DB file extension customizability #447

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using H2 in a desktop application in which I'm opening separate DB files 
for certain datasets. My problem is that H2 always saves the DB files with the 
.h2.db suffix.

I'd like to propose a feature request to allow the configurability of the 
extension mechanism in a way that the file name is completely in the control of 
the developer. The easiest might be is to introduce a new configuration 
variable usable in the DB URL as follows:

jdbc:h2:file:/test/my_db_file.myextension;USE_DEFAULT_SUFFIX=FALSE

When opening the DB this would create the 'my_db_file.myextension' file instead 
of 'my_db_file.myextension.h2.db'. The default value of this variable would be 
of course TRUE, thereby maintaining current behaviour.

In my current application I have to resort to manually renaming the file to 
contain the .h2.db suffix before opening the DB. Likewise, when closing I 
manually have to remove the suffix. This is a bit cumbersome and can be a 
source of problems in case the application or the system crashes without it 
having a chance to do the renaming.

Original issue reported on code.google.com by krisztia...@gmail.com on 11 Mar 2013 at 4:37

GoogleCodeExporter commented 9 years ago
This will be done in H2 version 1.4 (by default) unless there is a problem. 
This will also mean only one file is used (using the new storage engine 
"MVStore").

However, I don't plan to support it for H2 version 1.3.x, as it would add quite 
a lot of complexity.

Original comment by thomas.t...@gmail.com on 17 Mar 2013 at 4:13

GoogleCodeExporter commented 9 years ago
see also: https://groups.google.com/forum/#!topic/h2-database/Tpw8fc9sGBE

Original comment by egor@technoparkcorp.com on 10 Mar 2014 at 10:17