File Locking not released

Discussion on developing CloverETL engine, transformation components etc.

eontech
Posts: 3
Joined: Wed Oct 29, 2008 6:58 am
Location: GURGAON
Contact:

File Locking not released

Postby eontech » Thu Jan 15, 2009 1:53 pm

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.

jausperger
Posts: 19
Joined: Wed Apr 04, 2007 2:44 pm

Postby jausperger » Tue Jan 20, 2009 10:25 am

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?

jausperger
Posts: 19
Joined: Wed Apr 04, 2007 2:44 pm

Postby jausperger » Wed Feb 25, 2009 4:32 pm

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

jus
Posts: 12
Joined: Wed Feb 29, 2012 12:13 am

Re: File Locking not released

Postby jus » Thu Mar 22, 2012 9:11 pm

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:

Code: Select all

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

kubosj
Posts: 372
Joined: Thu Jan 12, 2012 9:10 am

Re: File Locking not released

Postby kubosj » Tue Mar 27, 2012 10:04 am

Jaroslav Kubos
CloverCARE Support
CloverETL | Rapid Data Integration

Visit us online at http://www.cloveretl.com


cron