cancel
Showing results for 
Search instead for 
Did you mean: 

Workaround multiple Transactions in SAP B1

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Former Member
0 Kudos

Do you recommend a treatment in code or using B1if?

Thanks for the help.


---

Regards,

Paulo Henrique Eli

Answers (3)

Answers (3)

pedro_magueija
Active Contributor
0 Kudos

Hi Paulo,

Not as a suggestion for a solution but, have you considered other architecture or technology for your scenario? You could use the DI-Server (or B1if) for the integration scenario leaving the DI-API free for your addons.

Just my two cents.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Pedro,

 

     I hadn't thought of this solution, go search.

     Do you know where I can find some example of use or documentation (license, use, release).

Regards,

Paulo Henrique Eli

pedro_magueija
Active Contributor
0 Kudos

Hi Paulo,

For the B1if this thread contains a good list of links to useful information:

For the DI-Server you can check here: but also have a look at the SDK Samples and help files. They contain the SOAP envelopes to use and also some more information.

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

Hi Paulo,

And DI-API is single-thread...

Regards,

Eric

Former Member
0 Kudos

Hi Eric,

     Yes, I'm aware. But, can you tell me if each AddOn uses a different transaction level? Or all AddOn share the same as B1?

Regards,

Paulo Henrique Eli

Former Member
0 Kudos

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

Former Member
0 Kudos

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