Solved

Data Flow Event Handler:  File Being Used By Another Process, Can't Move

Posted on 2011-02-20
10
350 Views
Last Modified: 2012-05-11
I have an onError event handler attached to my Data Flow task so that just in case I get a CSV file that is mis-formatted, I can move it into a Bad File folder.

The onError event fires, but it won't move the file because it says it is being used by another process.  I do not get this same type of error later in the Control Flow of the package when I attempt to move the file after successful processing.

Any ideas on how to release the file from the process first and then move?  I'm pretty sure it's being held by some DTS process but I have to believe it can be released and then moved.
0
Comment
Question by:davidcahan
10 Comments
 
LVL 4

Expert Comment

by:rocky_lotus_newbie
ID: 34939973
please check if you are able to find the details of the process locking the file after the OnError event fires from  -
Computer Managent -> Shared Folders -> Open files.

Thanks,
0
 

Author Comment

by:davidcahan
ID: 34960363
nothing
0
 
LVL 17

Assisted Solution

by:dbaSQL
dbaSQL earned 100 total points
ID: 34985020
If you're absolutely certain the file is not otherwise in use, possibly you should check the MaxConcurrentExecutables and EngineThreads:

http://stackoverflow.com/questions/4759892/file-in-use-error-in-ssis
http://blogs.msdn.com/b/sqlperf/archive/2007/05/11/implement-parallel-execution-in-ssis.aspx
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

Author Comment

by:davidcahan
ID: 34985058
It's definitely not in use by any other "entity" except the SSIS package.  I've actually read that this behavior (not being able to move a file source during a dataflow onError event) is a "bug".  
0
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 400 total points
ID: 34990082
It appears to make sense. The data flow has to be using it to throw the error, and its still effectively using it during the error event, so its locked.


Perhaps you should do one of the following:

1. Ignore it and move on the the next one. Assuming a successful file is moved to a 'processesd' folder then you know that everything thats left is a problem file and can be moved

Or...

2. Explicitly log the file path to a failure table. Then at the end of the process, go through this table and move them all.


0
 

Author Comment

by:davidcahan
ID: 34992813
that's actually a really good idea.  I never considered that.  my root folder can be both filles to process and failed files, while my archive can be successfully processed files.

thanks.
0
 

Author Closing Comment

by:davidcahan
ID: 34992819
I gave points to @dbaSQL also because I wasn't sure the links given actually solved my problem but I also didn't have enough time to fully test.  ultimately though @nmcdermaid's solution was the most feasible at the time.
0
 
LVL 17

Expert Comment

by:dbaSQL
ID: 34993419
Thank you for the points, davidcahan.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Virtual SQL Server 2014 Standard 35 85
Powershell v3 - SQLCMD 3 26
SQL Server Configuration Manager WMI Error 11 16
Parse this column 6 21
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

789 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question