Skip to Content
author's profile photo Former Member
Former Member

Transcations

Good Afternoon

Experts:

If I do not use <b>g_B1Connection.Company.StartTransaction()</b> to explicitly start a transaction, is there an ImplicitTransaction happening behind the scenes whenever I use an object?

My scenario:

I)Hit Add button to insert a new Material Requisition through our Add-on

2)An error occurs on the insert(maybe some problem in the Stored Procedure or invalid data)

3)I catch that problem and throw an exception resulting in a message in the

StatusBar of the screen

<b>Now, is there any kind of ActiveTransactions running in the background since

the insert failed?</b>

Is there a way to check for ActiveTransaction for the logged on User?

Thanks,

EJD

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 24, 2007 at 08:28 PM

    Ed ...

    I'm not sure if I understand well your question. But you can use the <b>StartTransaction </b>and <b>EndTransaction </b>methods to achive the rollback of a group of database statements if execution fails. Like this ...

                        msboCompany.StartTransaction()
                       '  
                       ' ****************** code here to update database *************
                       ' 
                       Try
                           msboCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_Commit)
                        Catch ex As Exception
                            msboCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                            SBO_Application.MessageBox("Error on function!" & vbCrLf & ex.Message)
                        End Try
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 29, 2007 at 12:43 PM

    Thanks for the input.

    EJD

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.