views:

19

answers:

2

What I want to do: My application has a full connection to a Derby DB, and I want to poke around in the DB (read-only) in parallel (using a different tool).

I'm not sure how Derby actually works internally, but I understand that I can have only 1 active connection to a Derby DB. However, since the DB is only consisting of files on my HDD, shouldn't I be able to open additional connections to it, in read-only mode?

Are there any tools to do just that?

+1  A: 
amra
It's embedded. Still, I hoped there would be a way to open the DB (read-only) in a separate JVM again. :-/
BennyB
See my update ...
amra
With Derby (and most other databases) it's technically not possible to get a consistent read-only 'view' of the database while another process is writing, because the writing process can overwrite data ('update in place').
Thomas Mueller
A: 

Two other ideas:

  1. In your application, shut down the database and close the connection when the database is not actively in use. Then your application won't interfere with another tool which is trying to open the database.
  2. Make a copy of your database, by taking a backup (you can do this while the database is open by your application), then restore that backup to a separate place on your disk. Then you can use another tool to access the copied database at your ease.
Bryan Pendleton