Page 1 of 1

Persistent Connection MySQL

Posted: Tue Nov 25, 2014 11:37 am
by Skinny
Hi.

Currently, sql.em module provides the use of the MySQL database. However, it is always necessary to connect and in the end of the routine it closes the connection when we run the same script N times.
A suggestion would be to use the mysqli_connect () so that persistent connection and avoid establishing new connections.

Regards,
Skinny.

Re: Persistent Connection MySQL

Posted: Thu Nov 27, 2014 3:10 am
by RusseL
You can create a script with infinite loop and events listner. Connect there to sql, wait for events and write events info into database whole time.

Re: Persistent Connection MySQL

Posted: Thu Nov 27, 2014 8:43 am
by Turley
This is also the recommended way of adding SQL support in your scripts. Since the SQL commands put the current script into sleep state until the SQL server responds. Depending where the SQL server is installed this can take several milliseconds even for simple get queries.

Re: Persistent Connection MySQL

Posted: Sat Dec 20, 2014 9:32 pm
by Skinny
I managed to create the script with the suggestions given by you. Thank you very much!