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 5994513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:49:42+00:00 2026-05-22T23:49:42+00:00

I have a scenario like below. Where the main method needs to call multiple

  • 0

I have a scenario like below. Where the main method needs to call multiple methods , 1 method for 1 table , and each method runs a set of statements which has to be atomic. So they are enclosed within a begin_work,commit,rollback block.

Also call_method_for_table1,call_method_for_table2,call_method_for_table3 should all succeed or fail together which means they have to be atomic. That is why begin_work,commit,rollback block are added in main method also. But i can see that perl does not allow me . I get exception – “DBD::ODBC::db begin_work failed: Already in a transaction”. Now i do not have any way of modifying the call_method_for_table* methods since it is in a library and modifying it is not possible due to many reasons.

Can i use checkpoints to solve this problem

  1. Will Savepoints help (http://msdn.microsoft.com/en-us/library/ms378414%28v=SQL.105%29.aspx)
  2. Will Rolling back till savepoint work even if there are some commits in between (which is usually the case in my example)
  3. Is it fine even when there are parallel runs of the same process ?
  4. Will it cause data inconsistency?
sub main {
        $dbh->begin_work;
           eval {
              call_method_for_table1();
              call_method_for_table2();
              call_method_for_table3();
              $dbh->commit;
              1; 
        };

        if ($@) {
              $dbh->rollback; }
       }

    sub call_method_for_table1 {
    $dbh->begin_work;
           eval {
           $dbh->do($INSERTSTATEMENT_TABLE1);
           $dbh->do($UPDATESTATEMENT_TABLE1);
           $dbh->do($DELETESTATEMENT_TABLE1);
           $dbh->commit; 
           };

           if ($@) {
             $dbh->rollback;
           }
    }
  • 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-22T23:49:43+00:00Added an answer on May 22, 2026 at 11:49 pm

    I think it’s impossible without modifying the call_method_for_tableX.

    Suppose call_method_for_table1 succeeds, then the commit is done and you can’t rollback after call_method_for_table2 eventually failed.

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

Sidebar

Related Questions

I have the following scenario(table below) where I would like to pick 'X' or
In a multithreaded scenario, I have a method like this: bool WaitForChange( time_duration WaitTime
I have a scenario like this: form = MockRepository.GenerateMock<IAddAddressForm>(); mediator = new AddAddressMediator(form); The
I will like to know: I have a scenario. If a user adds a
I have an architecture scenario and I would like to discuss to get your
Consider the scenario I have values assigned like these Amazon -1 Walmart -2 Target
Here's the scenario: I'd like to have a host class that can have a
I have a scenario. (Windows Forms, C#, .NET) There is a main form which
I have the webform with dropdown list, label and textbox. Like below: <asp:DropDownList ID=ddlTest
I have below scenario Got n as minimum number of rows required for the

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.