Yes. On Tuesday, July 23, 2013 1:10:48 PM UTC-4, Ayende Rahien wrote: > > Are you using one way bus? > > > On Tue, Jul 23, 2013 at 8:07 PM, Matty M <mpmi...@gmail.com > <javascript:>>wrote: > >> Thanks for the reply. If I understand you correctly, RSB DOES work within >> TransactionScope. I'm sure I'm just not doing it correctly. Below is my >> sample code (inside an MVC controller): >> >> public ActionResult Index() >> { >> var scope = new TransactionScope(); >> using (scope) >> { >> try >> { >> var message = new LoginAuditMessage >> { >> AuditId = Guid.NewGuid(), >> SessionId = Guid.NewGuid(), >> MessageText = "Login successful", >> ServerName = Environment.MachineName, >> LoginDate = DateTime.Now >> }; >> >> _bus.Send(message); >> >> throw new Exception("Unable to process db >> transaction! Messages should not be sent"); >> >> scope.Complete(); >> return View(); >> } >> catch (Exception exc) >> { >> return View(); >> } >> } >> } >> >> The message gets sent even though scope.Complete is never called (since >> the exception is thrown). What do I need to change in order to get the >> functionality I want? For example, if I wanted to make a DB call after the >> _bus.send line, I want both rolled back in the event an error is >> encountered with the DB transaction. >> >> >> On Tuesday, July 23, 2013 9:24:18 AM UTC-4, Matty M wrote: >>> >>> I'm playing around with Rhino Service Bus as an auditing tool >>> possibility. Let's say I have a scenario where I would like to perform a >>> transaction against a Sql Server DB and I also want to send a message about >>> the transaction using RSB. Ideally, I'd like to have all or nothing (if the >>> db transaction fails, the message gets rolled back). I tried wrapping the >>> bus.send inside of a transactionscope, but the message gets sent even if >>> scope.complete is never called. I was able to test NServiceBus with a >>> similar scenario and it worked as I expected. Can RSB do the same, or am I >>> barking up the wrong tree? >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Rhino Tools Dev" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to rhino-tools-d...@googlegroups.com <javascript:>. >> To post to this group, send email to rhino-t...@googlegroups.com<javascript:> >> . >> Visit this group at http://groups.google.com/group/rhino-tools-dev. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > >
-- You received this message because you are subscribed to the Google Groups "Rhino Tools Dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to rhino-tools-dev+unsubscr...@googlegroups.com. To post to this group, send email to rhino-tools-dev@googlegroups.com. Visit this group at http://groups.google.com/group/rhino-tools-dev. For more options, visit https://groups.google.com/groups/opt_out.