On 04.06.10 18:51, oldmhe wrote:
Prior to exiting, my Java program issues a shutdown, and then tries to delete
the DB directory (recursively), but is not able to completely delete the
directory.  Here's the code:

        try {
                DriverManager.getConnection("jdbc:derby:;shutdown=true");
        } catch (SQLException eSQLException) {
                if (
                                eSQLException.getErrorCode() == 50000
                                &&
                                "XJ015".equals(eSQLException.getSQLState())
                   ) {
                                                                                
// successful shutdown
                } else
                        printSQLException(eSQLException);
        }
        removeDir(new File(dbnmString));        // remove DB directory

(removeDir is my own function)

If removeDir() is called before connecting to the DB, it works fine.  But
the above call to removeDir() only deletes some of the files and directories
within dbnmString -- as if Derby is still accessing them (or has not closed
them).

I also tried dropping the DB just before the shutdown code, with the same
results.

Any ideas would be appreciated.

Hello,

What operating system are you using?
Are you able to use the operation system's proper tool to check which process (if any) is hanging on to the file?
(i.e. pfiles or lsof)

Also, do you see the same behavior if you in addition shut down the database explicitly?
(i.e. 'DriverManager.getConnection("jdbc:derby:myDB;shutdown=true");')


Regards,
--
Kristian



Reply via email to