Catch Block is sending mail multiple times

Hello everyone,

My Biztalk Solution Catch Block executes multiple times and not droping Errorfile into repositryfolder.

1)As Catch Block Executes it sends mail .

2)After sending Mail Error assign to a Message (System.String).

3)Send Error File to Folder.

When I process wrong file, mail send multiple times. Any help....

Expression Shape Contain following Code:

ErrMessage=Exception.Message+ "Orchestration Error";
System.Diagnostics.EventLog.WriteEntry("Orchestration", "Call to Email Utility");
System.Diagnostics.EventLog.WriteEntry("Orchestration : PurchaseOrderNO",PurchaseOrderNO);
Utility.EmailUtility.SendGeneralExceptionEmail(ErrMessage,PurchaseOrderNO);

Message Assignment Contain this

CatchErrorMessage="Exception Generated"+ ErrMessage;


February 25th, 2015 6:43pm

Hi Anurag,

In my view a catch block cannot execute multiple times. Is your catch block sending multiple error file to folder ? If yes then the issue is with your biztalk code and if No then the issue is with your send email utility. Your utility may be sending multiple emails. You can debug your BizTalk and utility code and revert back if anything strange is happening.

Regards,

Rahul Madaan

Free Windows Admin Tool Kit Click here and download it now
February 25th, 2015 11:52pm

Hi Anuraj,

My Biztalk Solution Catch Block executes multiple times and not droping Errorfile into repositryfolder

So the question here is

1) Are the events you logging in the expression shape getting logged multiple times?

2) Are any errors or warning registered in the event log after the mail is sent?

3) Is the messaging instance for the send port through which you are dropping the file to the repository getting suspended??

Please share the details for these three points.

Regards,

Mandar Dharmadhikari

February 26th, 2015 2:00am

Hi Anurag,

In the code you have shown, I dont see any error, other than your utility helper menthod..Utility.EmailUtility.SendGeneralExceptionEmail(ErrMessage,PurchaseOrderNO);

If youre not getting messages to your error folder, then more probable case is that the failure in the utility SendGeneralExceptionEmail method. And may be due to failure in this component, the control has not moved to its next step which is to send error message to the error folder.

You shall see some in eventlog, it depends on how your utility component is written. But for control not moving to send error message, you shall have some error in eventlog and orchestration in suspended state.

Free Windows Admin Tool Kit Click here and download it now
February 26th, 2015 5:30am

Problem Solved...

March 16th, 2015 11:28am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics