IBM Support

Adapter for Flat Files picks up incomplete files during inbound processing

Troubleshooting


Problem

During inbound processing, WebSphere Adapter for Flat Files polls files from the event directory. On Windows, if any of these files is in use by another application and being copied to the event directory, the file is not made available to the adapter for processing. However, on UNIX platforms (for example, AIX),the file that is still being copied over to the event directory is made available to the adapter for processing, which leads to incorrect business data being sent to the downstream components. There is also no platform-independent way in Java™ to check whether a file is being written to.

Symptom

This problem occurs because in UNIX environments there is no locking mechanism for files that are being written to that prohibits other applications from accessing them. Therefore, during its poll cycle, the adapter picks up files that are not completely copied, causing erroneous results because incomplete files are processed.

Resolving The Problem

Use a staging directory where the event file can be copied first, and once it is copied completely, it can be moved to the event directory using the move command. Note that the staging directory and event directory should be on the same file system. Some sample UNIX scripts are provided for your use as part of the adapter. The script file named CheckIfFileIsOpen.sh is available in the Unix-script-file folder in the adapter installer.

[{"Product":{"code":"SSMKUK","label":"WebSphere Adapters Family"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Adapter for FlatFiles","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"}],"Version":"7.0;6.2;6.1;6.0.2","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
15 June 2018

UID

swg21289976