Persistent Connection MySQL

Bug reports and feature requests. New features can only be added to the current development version. Bug-fixes may be back-ported.

Current release: 099 / Current development: 100
Post Reply
Skinny
Expert Poster
Posts: 76
Joined: Wed Dec 19, 2012 10:27 pm

Persistent Connection MySQL

Post 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.
RusseL
Forum Regular
Posts: 375
Joined: Fri Feb 20, 2009 8:30 pm

Re: Persistent Connection MySQL

Post 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.
Turley
POL Developer
Posts: 670
Joined: Sun Feb 05, 2006 4:45 am

Re: Persistent Connection MySQL

Post 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.
Skinny
Expert Poster
Posts: 76
Joined: Wed Dec 19, 2012 10:27 pm

Re: Persistent Connection MySQL

Post by Skinny »

I managed to create the script with the suggestions given by you. Thank you very much!
Post Reply