Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.
Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
User avatar
By programerboy
#812728
Hi,

I create a trigger like this:
Code: Select all
$db = '9092191375a376e9f2cb0d6057657207';
executeQuery('LOCK TABLES `table1` WRITE, `table2` READ;', $db);
executeQuery('insert into `table1` (`a`, `b`) values("data1", "data2");', $db);
executeQuery('UNLOCK TABLES;', $db);
But don't insert in my table1 and I don't get any errors.
When I execute only insert query it is true.

How can I use lock tables in trigger?

Thanks
User avatar
By amosbatto
#812749
You are going to have to modify the source code of the executeQuery() function defined in workflow/engine/classes/class.pmFunctions.php to allow it to execute LOCK and UNLOCK commands. I imagine that you can add this code:
Code: Select all
                case preg_match( "/^(LOCK|UNLOCK)\s/i", $statement ):
                    $rs = $con->executeUpdate( $SqlStatement );
                    $result = $con->getUpdateCount();
                    $con->commit();
                    break; 
But I haven't tried it.
Want to create your own meme coin?

In the world of cryptocurrencies, a unique and exc[…]

The market for cryptocurrencies is demonstrating a[…]

What's SAP FICO?

Embarking on a dissertation can be one of the most[…]

Hello. For rental housing, there are software solu[…]