Multithreading with Database (MySQL)

morpheus93

Client
Регистрация
25.01.2012
Сообщения
1 058
Благодарностей
244
Баллы
63
I want to have a project run in multiple threads that gets their input data from a MySQL database (and is also supposed to save the generated output data to the DB).

What points do I have to pay attention to and what is the easiest approach to run projects multithreaded in ZP that are linked to/from a database?
 

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
You can try using solution from here, if you deal with language barrier...) The main idea is to lock table to work in multithreading.
I think we need to translate this article to English...
 
  • Спасибо
Реакции: morpheus93

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Forget that, we work with database since 4.09 version and the best way to do multithread job is create a primary project who select data and save it into a list/table, after save that you must create a second project with related list/table as first block. The solution of post writed by vladzen work if you have only one ZP working in a project, don't work for us because we work with more than one ZP licence doing jobs in the same project, something like 25 threads of the same project in 3 different computers.
Make sense, if you work with database with some locks you will need to have one database for each project.
We are waiting for command to control how many threads one project is running to move our projects to a next level of "money maker".
 
  • Спасибо
Реакции: morpheus93

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Forget that, we work with database since 4.09 version and the best way to do multithread job is create a primary project who select data and save it into a list/table, after save that you must create a second project with related list/table as first block. The solution of post writed by vladzen work if you have only one ZP working in a project, don't work for us because we work with more than one ZP licence doing jobs in the same project, something like 25 threads of the same project in 3 different computers.
Make sense, if you work with database with some locks you will need to have one database for each project.
We are waiting for command to control how many threads one project is running to move our projects to a next level of "money maker".
This solution works for many russian users and got a prize in our competition.
If this is not suitable for you, that does not mean you should say "forget that".
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Forget that, we work with database since 4.09 version and the best way to do multithread job is create a primary project who select data and save it into a list/table, after save that you must create a second project with related list/table as first block. The solution of post writed by vladzen work if you have only one ZP working in a project, don't work for us because we work with more than one ZP licence doing jobs in the same project, something like 25 threads of the same project in 3 different computers.
Make sense, if you work with database with some locks you will need to have one database for each project.
We are waiting for command to control how many threads one project is running to move our projects to a next level of "money maker".
Why not making all PCs work each with local database and there would be one global database updater template on one another PC what will update Your main database from all your local DBs. It makes more sense to me to work that way.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Nah, the competition is a russian competition not a customers competition as well support for russians is very very expensive, in these days we have a bit better support for non russians but it still uncomparable support when compare to russian support.

If morpheus need a support he must learn russian language or he will don't receive any support, because this I said "forget that".
 
  • Спасибо
Реакции: morpheus93

VladZen

Administrator
Команда форума
Регистрация
05.11.2014
Сообщения
22 453
Благодарностей
5 913
Баллы
113
Nah, the competition is a russian competition not a customers competition as well support for russians is very very expensive, in these days we have a bit better support for non russians but it still uncomparable support when compare to russian support.

If morpheus need a support he must learn russian language or he will don't receive any support, because this I said "forget that".
you mix up support with community, russian zenno community is just bigger.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43
Why not making all PCs work each with local database and there would be one global database updater template on one another PC what will update Your main database from all your local DBs. It makes more sense to me to work that way.
In your mind work with 4 databases makes more sense than working with only one database?
 

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113
Nah, the competition is a russian competition not a customers competition as well support for russians is very very expensive, in these days we have a bit better support for non russians but it still uncomparable support when compare to russian support.

If morpheus need a support he must learn russian language or he will don't receive any support, because this I said "forget that".

Sorry, but I think You miss what means support and what means help and I surely did not understood what You mean support is expensive.
Support means You get resolved all Your issues related to ZennoPoster in general and only. This does not include any logical problem solving for Your projects. And there I can say everything is all right, @VladZen on working days are always available.
I can agree that in Russian side of forum there are more users so its bigger community therefore there are more HELP from other users about any questions included logical questions for your projects.
 

EtaLasquera

Client
Регистрация
02.01.2017
Сообщения
526
Благодарностей
112
Баллы
43

lokiys

Moderator
Регистрация
01.02.2012
Сообщения
4 812
Благодарностей
1 187
Баллы
113

Кто просматривает тему: (Всего: 2, Пользователи: 0, Гости: 2)