IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 3 replies
  • Latest Post - ‏2012-10-23T12:49:25Z by SystemAdmin
stefan123
stefan123
1 Post

Pinned topic Created file is picked up by an other process - who can we avoid a conflict

‏2011-02-07T16:56:34Z |
We are writing files to a dir using the flatfile adapter with the create operation.
The content is written in one step without any appends.
This file will be picked up by an other process for moving the file to an other
location.

How can we set up the configuration to be save in writing the file ?
We discuss about the staging feature but we are not sure if the description is really
describing what we want:

If a staging directory is specified in the StagingDirectory property, the file that is to
be created is copied from the output directory to the staging directory, and the
content is written for that file in the staging directory. The file is then moved back
to the output directory.

Specially what is the sense of the first step:
... the file that is to be created is copied from the output directory to the staging directory ?

Any hints are welcome ?
Updated on 2012-10-23T12:49:25Z at 2012-10-23T12:49:25Z by SystemAdmin
  • Joexuke
    Joexuke
    1 Post

    Re: Created file is picked up by an other process - who can we avoid a conflict

    ‏2011-02-11T06:27:26Z  
    Hi, there

    Regarding your business need, you can just ignore the staging directory feature, and create your target file into your target path directly, here we use the OutputDirectory for this path.

    StagingDirectory is designed to avoid thread conflict when same file is to be access by mutiple application instance during create or append operation. your file will be created in this temp directory before moved to the dir configured in OutputDirectory.

    Hope this can answer your question :)

    Any question, you can drop me a mail, xukke@cn.ibm.com
  • SystemAdmin
    SystemAdmin
    67 Posts

    Re: Created file is picked up by an other process - who can we avoid a conflict

    ‏2011-10-19T16:42:49Z  
    Hi,

    For the File Create operation in the FlatFile adapter when Staging Directory option is configured the file is first created in the Staging Directory, written into completely and then finally moved to the output directory.

    The scenario mentioned by you of file moving from Output directory to staging directory is possible in case of Append operation and not Create.

    In case of Append operation the file to be appended is copied from the output directory to the Staging Directory(if present) and the content is appended to that file in Staging Directory. Then the file is moved back to the original output directory.

    Hope the above information helps.
    Pls let me know if you have any more questions on this.

    Thanks,
    Vinod Valecha
    WebSphere Adapters
  • SystemAdmin
    SystemAdmin
    67 Posts

    Re: Created file is picked up by an other process - who can we avoid a conflict

    ‏2012-10-23T12:49:25Z  
    Hi,

    For the File Create operation in the FlatFile adapter when Staging Directory option is configured the file is first created in the Staging Directory, written into completely and then finally moved to the output directory.

    The scenario mentioned by you of file moving from Output directory to staging directory is possible in case of Append operation and not Create.

    In case of Append operation the file to be appended is copied from the output directory to the Staging Directory(if present) and the content is appended to that file in Staging Directory. Then the file is moved back to the original output directory.

    Hope the above information helps.
    Pls let me know if you have any more questions on this.

    Thanks,
    Vinod Valecha
    WebSphere Adapters