Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7636153
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:36:03+00:00 2026-05-31T07:36:03+00:00

I have this code: catch (Exception e) { try { transmitModel.AddAck(transmitBatchId, <error><message> + e.Message

  • 0

I have this code:

catch (Exception e)
{
    try
    {
        transmitModel.AddAck(transmitBatchId,
          "<error><message>" + e.Message + "</message><stack>" + e.StackTrace +
          "</stack><Location>FromLisAtOMServer<Location>" +
          "<TransmitBatchId>" + message.TransmitBatchId +
          "</TransmitBatchId></error>", false, true);
    }
    // If we fail to log, we don't want that to bubble up... 
    // We want the real error to do that.
    catch (Exception){}

    // Re-throw the exception so that the service bus will 
    // move this off to the error queue.);
    throw;
}

The AddAck method will save that string to the database (Using Entity Framework).

When I run this without the last statement throw, it saves my error message to database fine.

When I have the throw; in there, it says it saves but when I query the database it is not in there. I can even run a entity query via my data context right after saving (in the code) and it returns the value as if it is saved (though that may be using a cached version). But if I go and query afterwards the data is not there….

I have checked to be sure that no other logic is causing the value to be removed on an exception.

Any ideas what could be causing this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T07:36:04+00:00Added an answer on May 31, 2026 at 7:36 am

    OK, post as an answer here, it comes in my mind very easily as I used to met the same issue, and figured out it was just caused I didn’t commit the DB transaction.
    Thanks, 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code try { //AN EXCEPTION IS GENERATED HERE!!! } catch {
I have this code in java : try{ //some code here.. . } catch
I have this code: try { do_stuff(); return do_more_stuff(); } catch (UnsupportedEncodingException e) {
I have seen code like this (actually seeing another person type it up): catch
i have a problem using the Catch Clipboard Events code found on this link
I have this code: chars = #some list try: indx = chars.index(chars) except ValueError:
I have this code: try { SwingUtilities.invokeAndWait(new Runnable() { public void run() { try
I'm trying to fix an issue, in my application I have this code try
I have this code: try { using (FileStream fs = File.Create(path)) { } File.Delete(pathToStore);
i have this code and it is giving me this error i tried really

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.