I am using CloverETL 2.6 version for reading and loading the files into database. File locks are not released due to which I am not able to move the file to another folder. I tried investigating the issue and identified following issue in org.jetel.util.file.FileUtils class.
FileUtils. getInputStream method creates object on InputStream and if object is of type File then it creates new instance of FileInputStream
if (isFile) {
return new FileInputStream(url.getFile());
// RandomAccessFile raf = new RandomAccessFile(url.getFile()/*pridani kontextu*//*input*/, “r”);
// return raf.getChannel();
}
But the lock acquired by inputStream object is not released as its close method is not called.
I’m encountering a similar issue (using version 3.2.1).
I’m using ComplexDataReader to process SourceFile.txt. And then, on a subsequent phase in the same graph, I am using SystemExecute to move SourceFile.txt to an archive folder. But it’s giving me this error:
ERROR [SYS_EXECUTE1_0] - The process cannot access the file because it is being used by another process.
Another problem I’m having is renaming a file. I am using XLSDataWriter to write TargetFile.xls. And then, on the next phase in the same graph, I use SystemExecute to rename the file to add YYMMDD, i.e. TargetFile_120322.xls. This is giving me the same error above.
How can I close the file handle or unlock it? Please help!
Thanks!
Jus