Lost Messages in WCF-SQL Polling Receive Location

I’ve been having a problem with messages not appearing in a WCF-SQL receive location of late. The receive location polls for new data every 30 seconds using the polledDataAvailableStatement and then when it finds some rows to process, the pollingStatement extracts those rows and then returns them to BizTalk using a very simple Stored Procedure. This mostly works fine but mysteriously around 25% of the time the rows were set to processed but no message appeared in the BizTalk message box and the items were lost forever. There were no suspended or failed messages. No messages in the Event Log. Absolutely nothing. Very mysterious.

The solution is I think that whenever you have a polling statement that does anything other than a select statement which mine is as it updates the affected rows to PROCESSED = true, you have to set useAmbientTransaction to true. We had originally disabled this because we thought it might have been related to table locking behaviour we had experienced in our development environments.

This msdn article seems to support the solution.

Not performing operations in a transactional context is advisable only for operations that do not make changes to the database. For operations that update data in the database, we recommend setting the binding property to true; otherwise you might either experience message loss or duplicate messages, depending on whether you are performing inbound or outbound operations.

 

 

  1. Did this work for you? I am suffering the exact same problem even when the useAmbientTransaction is set to true!!

Reply to Jeremy ¬
Cancel reply


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>