Process
- Delete any old copies
- Create Copy of text file
- open copy & process
- archive original text file
The problem is that when i run the job from a unit test all is ok,
however when i shedule the job from Quartz i get file IO exceptions.
My guess is that a handle on the files is being maintained because the
Garbage collector is not running and clearing all the heap. If i where
to call GC.Collect() the heap would be cleared and thus the file
handles removed.
What are your thoughts on this and does Quartz doing anything special
on a job when it is finished i.e call DIspose if the job implements
IDisposable?
Thanks for you help in advance.
Glyn
Currently Quartz.NET does not handle IDisposable in any special
fashion. Have you double-checked that all our I/O code closes streams
it has used (maybe by using statement)? You could also try to null all
references your job has after it finishes to make them available for
garbage collection.
If you are using IStatefulJob also keep in mind that JobDataMap is
reused and that might create a memory leak if you use different keys
for your values.
Long running jobs may also create locking problems with your files, so
there might be need to check the modes you open your files with.
Hope this helps or gives you at least some pointers.
-Marko