This discussion is archived
11 Replies Latest reply: Dec 5, 2012 5:12 AM by 843007 RSS

File adapter: File with same file name is not picked up twice

843007 Newbie
Currently Being Moderated
Hi,

We have migrated a BPEL process from 10g to 11g, in 10g it used FTP adapter to pick up the files and as per the client requirement we changed to it to File adapter (since it is cluster we use HAFileAdapter).

The adapter reads the files as attachment. One strange behavior is that if i place files with new names it is picked up and processed. But files with same name is not getting picked up again. If i redeploy the process then it is picking up.

Any suggestions would be greatly appreciated.

THanks
  • 1. Re: File adapter: File with same file name is not picked up twice
    Pierluigi Vernetto Pro
    Currently Being Moderated
    i had the same problem and it drove me crazy- finally with oracle support we discovered that it was an improper configuration of the JCA properties, related to the threading model (can't remember the details):

    this proved to work:

    <adapter-config name="YourServiceNameHere" adapter="File Adapter" wsdlLocation="YourServiceNameHere.wsdl" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">



    <connection-factory location="eis/HAFileAdapter" UIincludeWildcard="*.xml"/>

    <endpoint-activation portType="Read_ptt" operation="Read">

    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">

    <property name="DeleteFile" value="true"/>

    <property name="MinimumAge" value="0"/>

    <property name="PhysicalDirectory" value="/data/bla/input"/>

    <property name="PhysicalErrorArchiveDirectory" value="/data/bla/input/error_stage"/>

    <property name="Recursive" value="true"/>

    <property name="PollingFrequency" value="5"/>

    <property name="IncludeFiles" value=".*\.(xml|XML)"/>

    <property name="UseHeaders" value="false"/>

    <property name="MaxRaiseSize" value="10"/>

    </activation-spec>

    </endpoint-activation>



    </adapter-config>


    In a nutshell the FILEADAPTERIN table was not cleared properly and the record would stay there forever, instead of being purged after processing the file
  • 2. Re: File adapter: File with same file name is not picked up twice
    veejai24 Pro
    Currently Being Moderated
    In this context, there is another scenario where if the file is not modified from last time stamp. Then it wont get picked up.
    Try to open the file and add some space and redo the work and save. This will change the time stamp of the file, this file is treated as modified file as per the adapter, this is for windows machine.

    If linux machine, you can do touch command to update the time stamp for the file.

    - It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).

    Thanks,
    Vijay
  • 3. Re: File adapter: File with same file name is not picked up twice
    AbhishekJ Expert
    Currently Being Moderated
    This behavior is by design and this is how high availability setup ensures that a file which is already being processed by one managed server does not get picked up by another managed server. The HA setup tags the name of first managed server which picks up the file so that other managed servers will not pickup the same file. This will mean that if the same file is received again, it will not be automatically processed. Even if you change the timestamp of the file it wont be processed. If you want to process the files with same name then there are following options:

    1. Redeploy the composite
    2. Rename the file to a new name
    3. If you know that the sender of the file may same files with same name multiple times, then you need to rethink the strategy to do it on a clustered environment and may be use a separate file system for managed servers instead of a shared filesystem and then putting the file only on one managed server and not on all.
  • 4. Re: File adapter: File with same file name is not picked up twice
    943698 Newbie
    Currently Being Moderated
    Hi Pierluigi,

    We have changed the JCA properties to look similar to the file you have mentioned. Still the service is not picking up the files with same file name.

    This is the JCA file we use.

    <adapter-config name="Servicename" adapter="File Adapter" wsdlLocation="../partnerWsdls/XXX.wsdl" xmlns="http://YY">

    <connection-factory location="eis/HAFileAdapter"/>
    <endpoint-activation portType="Read_ptt" operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
    <property name="AsAttachment" value="true"/>
    <property name="DeleteFile" value="true"/>
    <property name="LogicalArchiveDirectory" value="XXArchiveDirectoryPath"/>
    <property name="MinimumAge" value="60"/>
    <property name="Recursive" value="true"/>
    <property name="PollingFrequency" value="60"/>
    <property name="LogicalDirectory" value="XXInputDirectoryPath"/>
    <property name="FileType" value="ascii"/>
    <property name="IncludeFiles" value=".*invcpymt\.txt"/>
    <property name="UseHeaders" value="false"/>
    <property name="MaxRaiseSize" value="10"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>

    Please help to resolve the same.

    Thanks,
    Vinoth
  • 5. Re: File adapter: File with same file name is not picked up twice
    AbhishekJ Expert
    Currently Being Moderated
    Please see my comments above. I dont think its possible for file adapter to read multiple files with same name (coming at different times) when using HAFileAdapter in a cluster.
  • 6. Re: File adapter: File with same file name is not picked up twice
    Pierluigi Vernetto Pro
    Currently Being Moderated
    ". I dont think its possible for file adapter to read multiple files with same name (coming at different times) when using HAFileAdapter in a cluster."

    I assure that it is possible, it works like a charm here on a clustered environment with HAFileAdapter

    Check the table FILEADAPTER_IN, probably the previous record is not being purged.

    Please post here your configuration, make sure also that the Proxy doesn't override the JCA configuration
  • 7. Re: File adapter: File with same file name is not picked up twice
    843007 Newbie
    Currently Being Moderated
    My JCA configuration is as follows, You mentioned that "previous record may be not deleted". How do we make sure that it is purged, any other configuration needed.

    Also what do you mean by "Proxy" here

    <adapter-config name="Servicename" adapter="File Adapter" wsdlLocation="../partnerWsdls/XXX.wsdl" xmlns="http://YY">
    <connection-factory location="eis/HAFileAdapter"/>
    <endpoint-activation portType="Read_ptt" operation="Read">
    <activation-spec className="oracle.tip.adapter.file.inbound.FileActivationSpec">
    <property name="AsAttachment" value="true"/>
    <property name="DeleteFile" value="true"/>
    <property name="LogicalArchiveDirectory" value="XXArchiveDirectoryPath"/>
    <property name="MinimumAge" value="60"/>
    <property name="Recursive" value="true"/>
    <property name="PollingFrequency" value="60"/>
    <property name="LogicalDirectory" value="XXInputDirectoryPath"/>
    <property name="FileType" value="ascii"/>
    <property name="IncludeFiles" value=".*invcpymt\.txt"/>
    <property name="UseHeaders" value="false"/>
    <property name="MaxRaiseSize" value="10"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>

    Edited by: Vinoth on Nov 30, 2012 9:03 AM

    Edited by: Vinoth on Nov 30, 2012 9:04 AM
  • 8. Re: File adapter: File with same file name is not picked up twice
    Pierluigi Vernetto Pro
    Currently Being Moderated
    the JCA looks fine
    check also the configuration of your FileAdapter deployment, the eis/HAFileAdapter factory, make sure that controlDir exists on the disk, that the 2 datasources SOADataSource and SOAXADataSource exist, that you have a FILEADAPTER_IN table, and if any record are left stagnant in it.

    Google for HAFileAdapter and FILEADAPTER_IN and you will find some posts on javamonamour....

    But believe me, it definitely works, we have been using it for months in production without a glitch.
  • 9. Re: File adapter: File with same file name is not picked up twice
    843007 Newbie
    Currently Being Moderated
    Hi,

    I have verified the configuration of the adapter you have mentioned it has all of them that you have mentioned.

    But i see that the records are not getting removed from FILEADAPTER_IN table.

    The entry stays there forever, even after successfully processing the file. It marks the file_processed status to 2, and does not purge the record.

    What could cause the record not to be deleted from the table.
  • 10. Re: File adapter: File with same file name is not picked up twice
    Pierluigi Vernetto Pro
    Currently Being Moderated
    it looks exactly like our case,
    our problem is that we had enabled
    <property name="SingleThreadModel" value="true"/>

    which was preventing the "cleanup" thread from running.....

    Are you by any chance using some Single thread work manager with your HAFileAdapter of the services using it?

    Do you see anything related to threading issues in the logs? A good analysis of the logs could help spotting the issue....

    I would suggest you open a support case, you can mention      SR 3-5822413031 where Monica Gragnola solved our issue, she really knows everything about these components.
  • 11. Re: File adapter: File with same file name is not picked up twice
    843007 Newbie
    Currently Being Moderated
    Hi,

    We raise the ticket and look for the solution.

    Meanwhile, if we use FTP adapter will cause same issue.

    Can it handle the same file name in cluster.

    Thanks

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points