on 03-10-2010 3:11 AM
Dear Experts,
I have an AddOn made in .net 2005 wich creates multiple invoices per user, in this company there are multiple users trying to create invoices through this AddOn. Here are my questions...
a. Would It be helpful if i use oCompany.InTransaction so that the "Posting to Invoice" process will be FIFO for scenarios that multiple users posts their invoices at the same time.
b. Will it work on MS SQL 2005 ?
c. Would you like me to post my code for clarifications?
Best Regards,
Frabulous
Hello,
You can use the transaction object. You should know, that the huge global transaction is "blocking' the system.
During the transaction, if your objects have any errors, the transaction is automatically rolled back.
Usage:
Try
If oCompany.InTransaction Then
MsgBox("Cannot start transaction, becuase the previous transaction has not been finished!")
End If
oCompany.StartTransaction()
' Do your transaction here
'
' Commit the transaction
oCompany.EndTransaction(BoWfTransOpt.wf_Commit)
Catch ex As Exception
If oCompany.InTransaction Then oCompany.EndTransaction(BoWfTransOpt.wf_RollBack)
Finally
GC.Collect()
End Try
Regards,
J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Whether you use StartTransaction/EndTransaction or not depends on what way invoices are created.
Do the invoices belong to each other, you can use transactions - in case one add fail, the other invoices are rolled back.
If this is not the case, each Add is a transaction by its own, you dont really need to use transactions.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
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.