Long-running transaction

  • Thread starter Thread starter Pierre
  • Start date Start date
P

Pierre

A business logic component creates a registration request for an asp.net
application and it inserts the request to the database. The data access
component returns a request key for the inserted request. After receiving
the key the business logic component sends an email to the user. This whole
process must be a logical transaction. I mean when an error occurs during
sending of the email the system must rollback the request inserted to the
database. For now I just catch if an exception occurs during sending and
delete the request from the database. Is there a more efficient way or a
pattern for this kind of "transactions"?
 
Hi,
For now I just catch if an exception occurs during sending and
delete the request from the database. Is there a more efficient way or a
pattern for this kind of "transactions"?

You can create ServicedComponent and implement a method in it,
which will send your message to a client. Then you can mark it as
transactional. So, sending of an e-mail can participate in distributed
transaction under DTC control.

Take a look at the following article in MSDN:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpguide/html/cpconwritingserv
icedcomponents.htm

Hope this helps.
 
Back
Top