I have just started to use Derby for configuration data for an application and have found that whenever the app terminates unexpectedly then Derby will not start the next time I start the application as it complains that it’s already been opened.  At the moment, I need to reboot my machine to clear whatever flag/data is indicating that the database is still open.

 

Is there a cleaner way to close the database?  Ideally my app would try to start Derby  and if it gets the error about it already being open then it would somehow clean up and close the database (that is if the application is not actually running in another instance already) and then open it properly.

 

And loving it,

 

John C. Turnbull

 

_________________________________________________

"The old lighter-in-the-gun-in-the-rabbit trick!"

                                   -Maxwell Smart