File Locking not released

Hi,

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.

Hello, could you send more information, all graph or describe your use case? I suppose you have tried this on Windows. What reader does it?

Try universal data reader, that is ok. I found out deprecated delimiter data raeder don’t close the files… in version 2.6

Hi there,

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

Hi jus,

see viewtopic.php?f=5&t=5233&p=8403&sid=e07332bbe0ab908e3380272ca44a8462#p8403 for answer.