droid
droid copied to clipboard
Directories in profiles are not deleted
When I run any droid command for example:
droid.bat -a "c:\yyy" -p "c:\zzz.droid" -R
In directory C:\Users\xxx.droid6\profiles is created new directory.
In droid 6.4 this directory is deleted when command finishes, but in 6.5 it is not deleted. Every command causes new directory creation.
.droid/droid.properties are default and contains:
development_mode = false
Confirmed this happens using the Windows-only DROID 6.5 with embedded java version, on Win 10. Tried on Windows 10 with Oracle Java 8 installed, using the all platforms version, and also does not delete.
Works correctly on Linux using the all platforms version, using openjdk 11.
So looks like something to do with running this code on Windows, not the version of the code itself or the version of Java. The code itself that performs the deletion doesn't appear to have changed for 6.5.
I don't currently have a dev environment set up in Windows to debug this currently, so looking for someone else to step through the ProfileManagerImp.closeProfile() method and see what's happening under Windows.
it looks like closing the profile does not release references to the files in the derby database. The reference is released only when the Java process is terminated (i.e. Droid is shutdown) hence the files cannot be deleted. The error says the "files are being accessed". Also, I think, if there are any files within that profile that are encountered before the derby database, they would be successfully deleted, which could leave the profile in an unknown state. In my trials, the derby db deletion was one of the first ones but I don't know whether that order is guaranteed
It would make sense the difference between Linux and windows here. Linux files can be deleted even if something has a file reference open, windows file system does not allow it.
Thanks Matt 👍🏼 My suspicion is, the derby driver might have changed rather than something within the droid code, I'll take a look to see if there is something that needs to be done to explicitly clear file reference in derby.