Re: keeping Mysql connection live between function calls
Hi Chris,
One of the good practices when managing a database resource is to keep the connections as atomic as possible. I'm not sure if I understand what you want to achieve but if you want to save some lines of code then you can call your method by passing a reference for the object and then return the same object with the open connection. And do the rest of the operations. Then you'll have to pass this same object by reference to the method that closes the connection.
Also you can check which connections are open by running SHOW PROCESSLIST inside a mysql console. Here is the documentation:
http://dev.mysql.com/doc/refman/5.0/es/show-processlist.html
Hope this helps.
Subject
Written By
Posted
November 04, 2013 09:19AM
Re: keeping Mysql connection live between function calls
November 04, 2013 11:00AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.