Xyna-Factory / xyna-factory

Sources of the Xyna Factory Server, Xyna runtime applications (like GuiHttp or gitintegration), and installation scripts.
Apache License 2.0
16 stars 3 forks source link

Use DB locks for MySQL/MariaDB table modifications #1248

Open csc-gip opened 2 weeks ago

csc-gip commented 2 weeks ago

In order to allow multiple factories to use the same database use locks for alter table/column and create/alter table. This way factories can start in parallel without running into errors (most of the time and during initial startup). In case alter statements take a long time, a factory which is unable to obtain a lock, should exit with an error.

https://mariadb.com/kb/en/get_lock/ https://dev.mysql.com/doc/refman/8.4/en/locking-functions.html

Also: Add readOnly parameter to disable write access to a PL. Write access to a read only PL should always be treated as an error (PL exception).