I have a few Gearman workers that are implemented on php. Each task for these workers should be executed in the own transaction. In order to have access from these workers to my MySQL db I need something like a connection pool. Could you please suggest something for that(library, framework and so on)? Thanks
Asked
Active
Viewed 496 times
0
-
I don't see a problem: Start transaction at the beginning of each task and commit at the end of each task. However having tasks 1-n running in parallel transaction safe is completely different story. – Goran Miskovic Jun 13 '13 at 21:40
1 Answers
1
Client creates SQL statements
Client passes SQL statements to mysql worker (in a batch or just one long string of statements)
Worker performs the sql.
Clearly there is security to worry about but the implementation should be simple and require no need for library.
This may be good if you know your going to have high levels of transaction lock as the jobs can be processed in the background.

Simon Bennett
- 355
- 3
- 8