Question

Multithreading when working with database

I'd like to use Parallel to do some database tasks. But when I follow this article, I see that the second example is one thread only.

https://academy.creatio.com/documents/technic-sdk/7-16/multithreading-w…

 

How should I do to work with multithreading?

Like 0

Like

3 comments

Hello Van Ly, 

 

Using several streams in working with the database via UserConnection may cause issues in starting synchronization or committing transactions. You cannot call the DBExecutor instance methods in the parallel threads. It is recommended to make sure that the call of DBExecutor instance methods is performed consistently in one thread.

 

Please, let us know in case any further information is required. 

 

Best regards, 

Olga. 

Olga Avis,

Yes I known it. Does it mean that we cannot use multithreading in any way?

 

Dear Van Ly,

 

It is strongly not recommended since it could cause further system failures.

 

Best regards, 

Olga. 

Show all comments