Issue Details (XML | Word | Printable)

Key: DERBY-4093
Type: Sub-task Sub-task
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kristian Waagan
Reporter: Kristian Waagan
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby
DERBY-646

Improve handling of the database temporary directory

Created: 13/Mar/09 12:43 PM   Updated: 02/Jul/09 12:00 PM
Component/s: Store
Affects Version/s: 10.5.1.1
Fix Version/s: 10.5.1.1

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-4093-1a-tmp_dir_handling.diff 2009-03-13 01:05 PM Kristian Waagan 4 kB
File Licensed for inclusion in ASF works derby-4093-1b-tmp_dir_handling.diff 2009-03-13 01:24 PM Kristian Waagan 4 kB

Resolution Date: 13/Mar/09 01:25 PM


 Description  « Hide
The problem reported by Knut Anders Hatlen in DERBY-646 is caused by improper handling of the temporary directory created for the database.
A NullPointerException was thrown on database shutdown.

After studying the code, I believe it is wise to follow the approach taken by the base storage factory;
 o locate the temporary directory within the database directory
    (i.e. for database 'mydb' this will by 'mydb/tmp')
 o don't create the temporary directory before Derby supplies a unique name to the storage factory

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kristian Waagan added a comment - 13/Mar/09 01:05 PM
Patch 1a fixes the improper handling of the temporary database directory.
The directory will always be created as <database_directory>/tmp
Added two tests, one for database shutdown and one for engine shutdown.

I'm committing this patch ASAP, but feel free to still comment on it.

Kristian Waagan added a comment - 13/Mar/09 01:24 PM
Patch 1b contains a few changes to the tests (make sure tests fail if exception on shutdown isn't thrown, and reload the engine code after engine shutdown).

Kristian Waagan added a comment - 13/Mar/09 01:25 PM
Committed patch 1b to trunk with revision 753239.
Keeping the issue open for a while to handle any problems and address comments.

Knut Anders Hatlen added a comment - 13/Mar/09 01:40 PM
Thanks, I don't see the NPE now.