- Home /
Performance Question MySQL
Hello, I have a server with a Mysql Database.
Every time an users logged in, create account, loosing life, .. the server is opening a mysql connection, execute mysqlcommand, close connection.
Now I think this isnt needed and I want to open the mysql connection 1 Time and close the connection only when server is turned off.
So is it a good idea to leave the mysql connection opened? (Does it get timeouts sometimes?) Or is it a better way to connect/disconnect for every command? Same question goes to the Mysql Reader (Ive expected some bugs when dont turn off the reader every time)
Here is my current code: Thanks
public class mysqlconn : MonoBehaviour{ //Define connection (new MySqlConnection) }
function 1{open connection, execute, close connection} function 2{open connection, execute, close connection}
Answer by TaigaStudios · Jul 03, 2010 at 11:51 AM
After looking around I found on stackoverflow recommendation to close the connection for effeciency. Google is your friend.
Your answer
Follow this Question
Related Questions
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Best way (performance) to connect to a (MYSQL) DB 2 Answers
Setup mySQL, insert value to mySQL, retrieve data from mySQL 0 Answers
Modifying PlayerSettings for RenderPath 1 Answer
Non-uniform Scaling Performance Issues. Need advice. 1 Answer