Hi. This may be a bit long winded so I will try to be a succinct as I can. Up until ‘recently’ this process as worked fine.
Server Version: 126.96.36.199
- Retrieve list of files from a PENDING folder that have an extensio nof .xml
- Iterate over the list and call a sub-project
3. Extract the required data from the XML file and derive a new table that is passed back to the parent project
4. Return the derived table to PARENT project
5. TRUNCATE SQL Server Staging Table
6. Push the data to staging table
7. Execute Stored Procedure to production table populating foreign keys etc
8. Call a Windows batch script to MOVE the original .xml file to a PROCESSED Folder
9. REPEAT for each File in Parent Table
We have exactly the same process in different projects based on file types (CSV, XLS etc)
All Good so far…
Today, we find that the XML processing fails at step 8 and the reports that the file cannot be MOVED as it is in use. After some forensics I have discovered that it is EasyMorph Server that has it still open and the Open Files console on Windows shows the same file opened and never released every time we re-run the scheduled server project.
I have included a screen shot showing this.
It seems to me that the XML read process is not releasing the file handle when it returns from the sub-project at step 4. This creates a problem later for the windows batch command to MOVE the file as it considers the file to be locked and a copy/rename and delete (aka a MOVE) is not possible.
As I have said we have different projects to handle CSV and XLS files from different trading partners but the flow of each is identical. It is just the sub-project that changes and in this case we do some pivoting to extract the data we need out of the XML and then push that back to the parent project for a downstream push to the database.
It is difficult for us to provide a sample as we are dealing with sensitive data.