Announcement Announcement Module
Collapse
No announcement yet.
Unable to delete file created in one Tasklet Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Unable to delete file created in one Tasklet

    Hello,

    we are facing a what seems to be file lock issue:
    We have defined a Tasklet where we create a new file by copying another one from a remote location(apologies for the hypothetical tags but you get the point.. ):
    Code:
    <step1>
    <tasklet>
       public RepeatStatus execute(StepContribution stepContribution, ChunkContext chunkContext){
      ................
      FileUtils.copyFileToDirectory(remoteZipFile, zipFileLocalCopyDirectory, true);
      ................
    }
    </tasklet>
    </step1>
    and then a final Tasklet which attempts to delete that file:
    Code:
    <step2>
    <tasklet>
      .................
      FileUtils.cleanDirectory(zipFileLocalCopyDirectoryProvider.getDirectory());
      .................
    </tasklet2>
    <step2>
    that call fails because Tasklet from step1 seems to still be holding a lock on that file..

    Any ideas/input on why this is happening and how we can solve the problem much appreciated. We are using the commons FileUtils is that plays any role.

    Regards,
    Savvas

  • #2
    ..never mind..our bad..the lock was being acquired (and never released..) elsewhere..

    Comment

    Working...
    X