on 05-24-2007 6:51 PM
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
Thanks for the input.
EJD
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Good Evening
Thanks for replying Neftali. I uderstand the usage of the StartTransaction and EndTransaction. In situations where I do not utilize that in SAP and there is an error with a database function(S/P call etc...), is there a Transaction out there in the background hanging around?
If so, how can I find if there is one?
Thanks,
Ed
Hey:
I just meant calling a SQL S/P from within SAP. The error could result from a simple update or insert to the database.
So, I guess my inquiry comes down to -->what happens in SAP if I do not use the StartTransactio and EndTransaction? Does SAP still start a Transaction that gets stuck "out there"? If so, how can I tell if this is the case?
EJD
Well
Quick answer ... I don't know! It is a good question for SAP.
I believe the official word by SAP is that Store Procedures are not supported. Store Procedures (eventhough you can actually call them ... I suppose is for UD store procedures)
If you are calling one of your own store procedures I believe you can make the store procedure return an error code and then see if SAP's function call return that value
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.