I'm using BerkeleyDB (version 184.108.40.206) and accessing the sqlite interface through JDBC.
I'd like to be able to backup the database to then open it on a new machine. The database home directory
has a DB_CONFIG file with the following content:
set_open_flags DB_THREAD on
set_open_flags DB_PRIVATE off
Here's what I do to backup the db on machine A and open the db on machine B:
1) I stop the execution of transactions on A
2) I then run the following commands on A using Runtime.getRuntime().exec(command) calls:
a) db_hotbackup -c -h <db_home> -b <bckup-directory>
b) db_load -r lsn -h <bckup-directory> <dbName>
c) db_load -r fileid -h <bckup-directory> <dbName>
3) I send the database files and respective logs to B. Machine B stores them in the standard way, that is,
the database files are in the home directory, and logs are in a <databaseName>-journal sub-directory.
4) Machine B opens a connection to the database using JDBC and tries to execute transactions. Unfortunately,
the first preparedStmt.executeQuery() I try to execute returns a SQLException:
Caused by: SQLite.Exception: error in prepare
at SQLite.Database.vm_compile_args(Native Method)
Note that the query executes perfectly well when the database is created and populated on machine B. I should
also add that running a db_verify on the databases on B after the transfer tells me that the verification succeeded.
What have I done wrong? Any help would be really appreciated.