Page 1 of 1

Usage of the DSLogFatal function

Posted: Tue Jun 13, 2006 5:13 am
by katz
I have questions regarding the DSLogFatal Function. The BASIC Guide warns that DSLogFatal should not be used in a transform. Use DSTransformError instead. However, the DSTransformError function only logs a warning message, not a fatal one.

The sdk routine UtilityAbortToLog uses the DSLogFatal function but warns, in its Long Description, The routine should not be used in production.

I understand that it is preferred practice to always pop-off all the program stack entries to cleanly exit the process, but what are the real potential consequences of using the DSLogFatal function in a Transformer, or using the UtilityAbortToLog routine in production? (e.g. orphaned resources, corrupted job status, etc.?).

Supposing that I want to abort a server job; side-stepping any debate whether this is good practice, or not. How do I manage the 'cleanest possible' abort from within the job (i.e. excluding methods using Before-After routines that return a non-zero return-code)?

Thanks,
katz

Posted: Tue Jun 13, 2006 6:16 am
by kduke
DSLogFatal will log a message before it fails the job. I think it would be cleaner.

Posted: Tue Jun 13, 2006 6:21 am
by ArndW
I agree with Kim - DSLogFatal() should be used in your case. The warnings have more to do with having devlelopers avoid terminating jobs than with any side-effects involved in using the function.

Posted: Wed Jun 14, 2006 4:01 am
by katz
Thanks for you replies.

I have always used the DSLogFatal function in instances where there is an imperative need to abort the job, but on this project I need to justify its use in light of the warning printed in the BASIC guide.

I was thinking that there is perhaps a better method to abort the job, which I was unaware of.

katz

Posted: Wed Jun 14, 2006 5:43 am
by kduke
katz wrote:Thanks for you replies.
I was thinking that there is perhaps a better method to abort the job, which I was unaware of.

katz
Not really.