Multithreading with Database (MySQL)

Discussion in 'Questions' started by morpheus93, Feb 12, 2019.

  1. morpheus93

    morpheus93 Client

    Joined:
    Jan 25, 2012
    Messages:
    307
    Likes Received:
    21
    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?
     
  2. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    13,981
    Likes Received:
    3,404
    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 likes this.
  3. EtaLasquera

    EtaLasquera Client

    Joined:
    Jan 2, 2017
    Messages:
    292
    Likes Received:
    59
    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 likes this.
  4. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    13,981
    Likes Received:
    3,404
    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".
     
  5. lokiys

    lokiys Moderator

    Joined:
    Feb 1, 2012
    Messages:
    3,566
    Likes Received:
    804
    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.
     
  6. EtaLasquera

    EtaLasquera Client

    Joined:
    Jan 2, 2017
    Messages:
    292
    Likes Received:
    59
    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 likes this.
  7. VladZen

    VladZen Administrator Staff Member

    Joined:
    Nov 5, 2014
    Messages:
    13,981
    Likes Received:
    3,404
    you mix up support with community, russian zenno community is just bigger.
     
  8. EtaLasquera

    EtaLasquera Client

    Joined:
    Jan 2, 2017
    Messages:
    292
    Likes Received:
    59
    In your mind work with 4 databases makes more sense than working with only one database?
     
  9. lokiys

    lokiys Moderator

    Joined:
    Feb 1, 2012
    Messages:
    3,566
    Likes Received:
    804

    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.
     
  10. EtaLasquera

    EtaLasquera Client

    Joined:
    Jan 2, 2017
    Messages:
    292
    Likes Received:
    59
    With better support from dev team.
     
  11. lokiys

    lokiys Moderator

    Joined:
    Feb 1, 2012
    Messages:
    3,566
    Likes Received:
    804
    If You have problems working with one Database then working with 4 or 10 databases if that's solves my problem, makes sense to me. ;-)
     

Пользователи просматривающие тему (Пользователей: 0, Гостей: 0)