class PackedDatabase extends Database {

	public void dispose() {
		if (!isCached && dbDir != null && dbDir.exists()) {
			File tmpDbDir = new File(dbDir.getParentFile(), dbDir.getName() + ".delete");
			if (!dbDir.renameTo(tmpDbDir)) {
				Msg.error(this,
					"Failed to dispose PackedDatabase - it may still be in use!\n" + packedDbFile,
					new Exception());
				return;
			}
			deleteDir(tmpDbDir);
		}
		if (dbHandle != null) {
			dbHandle = null;
			if (updateLock != null && updateLock.haveLock(true)) {
				updateLock.removeLock();
			}
		}
		if (packedDbLock != null && packedDbLock.haveLock(true)) {
			packedDbLock.removeLock();
		}
		removeInstance(this);
	}

	private  PackedDatabase(ResourceFile packedDbFile);
	  PackedDatabase(ResourceFile packedDbFile, LockFile packedDbLock, CachedDB cachedDb,
			TaskMonitor monitor);
	  PackedDatabase(PackedDBHandle dbHandle, ResourceFile packedDbFile, String itemName,
			Long newDatabaseId, TaskMonitor monitor);

}