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
Labels:


 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 made changes - 13/Mar/09 12:52 PM
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
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 made changes - 13/Mar/09 01:05 PM
Attachment derby-4093-1a-tmp_dir_handling.diff [ 12402140 ]
Repository Revision Date User Message
ASF #753239 Fri Mar 13 13:23:24 UTC 2009 kristwaa DERBY-4093: Improve handling of the database temporary directory.
Defers creation of the temporary directory until Derby is ready (when
uniqueName is specified), and makes the temporary database directory
always be created within the database directory.
Patch file: DERBY-4093-1b-tmp_dir_handling.diff
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/impl/io/VFMemoryStorageFactory.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/memorydb/BasicInMemoryDbTest.java

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 made changes - 13/Mar/09 01:24 PM
Attachment derby-4093-1b-tmp_dir_handling.diff [ 12402142 ]
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.

Kristian Waagan made changes - 13/Mar/09 01:25 PM
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s 10.5.0.0 [ 12313010 ]
Resolution Fixed [ 1 ]
Knut Anders Hatlen added a comment - 13/Mar/09 01:40 PM
Thanks, I don't see the NPE now.

Myrna van Lunteren made changes - 04/May/09 06:22 PM
Affects Version/s 10.5.1.1 [ 12313771 ]
Affects Version/s 10.5.0.0 [ 12313010 ]
Fix Version/s 10.5.1.1 [ 12313771 ]
Fix Version/s 10.5.0.0 [ 12313010 ]
Kristian Waagan made changes - 02/Jul/09 12:00 PM
Status Resolved [ 5 ] Closed [ 6 ]