on 09-16-2014 1:00 PM
Greetings,
I have an AddOn that has several Threads, working as services. These services in their vast majority make integration with the Government.
The problem happens when any screen (AddOn) uses a transaction. To end the transaction or start, error occurs because the transaction would be being used by a service (Thread). To complicate matters, theoretically, the process of the screen should have priority over the Threads. Does anyone have any suggestions? As far as I know, the SAP SDK only supports a single transaction for every application.
Any help will be appreciated.
Regards,
Paulo Henrique Eli
Hi Paulo,
Prior to the B1 9.1, the DI API/DI Server/B1 are single thread. It is not safe at all to use multi-thread in you add-on. The main concern is that Company object is holding some static environment variable as critical section, which is not implemented as multi-thread.
However, good news, since B1 9.1 version, B1/OBServer/DI API/DI Server can support multi-threading in a safe way.Therefore, you're recommended to go for B1 9.1 instead.
Kind Regards, Yatsea
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paulo,
And DI-API is single-thread...
Regards,
Eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Paulo,
As far as I know (SQL-Traces) all add-ons share the same transaction than B1.
As suggested by Alessandro, you can also in specific cases for ce a different transaction, but be aware that it will not work in every single cases (I remid a test I did some weeks ago, for somebody who wanted to post an invoice followed immediatly by a payment: you just cannot include both operations in a user transaction, else it will break).
Regards,
Eric
hi,
maybe you can check if ocompany is in transaction.
If ocompany.InTransaction = False Then
''''''''''execute your code transaction''''''''
End If
I hope this help you
Regards, Alessandro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
99 | |
11 | |
11 | |
6 | |
6 | |
4 | |
4 | |
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.