Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

tep_db_free_result


joyfactor

Recommended Posts

Posted

I've encountered an issue on my hosting provider: a 1040 mysql connection refused error, too many connections.

 

I assumed that osc released result resources, and I found the fnc tep_db_free_result in /includes/functions/databases.php. However, I could not grep a single use of this function in osc.

 

How are mysql result resources being freed by osc?

Posted
I've encountered an issue on my hosting provider: a 1040 mysql connection refused error, too many connections.

 

I assumed that osc released result resources, and I found the fnc tep_db_free_result in /includes/functions/databases.php. However, I could not grep a single use of this function in osc.

 

How are mysql result resources being freed by osc?

 

 

mysql_free_result() will free all memory associated with the result identifier result.

 

mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution.

Treasurer MFC

Posted
mysql_free_result() will free all memory associated with the result identifier result.

 

mysql_free_result() only needs to be called if you are concerned about how much memory is being used for queries that return large result sets. All associated result memory is automatically freed at the end of the script's execution.

 

 

I suggest that osc should free ALL result resources, and I'm pretty surprised (shocked) it does not. As more and more people utilize shared hosting combined with things like osc, and as those hosting providers fill up, this error will become more and more pronounced.

 

My feature request is that each and every result resource be released precisely when it is no longer needed. This will become even more urgent when the database layer is made abstract (i.e., not mysql bound).

 

joy

Posted
I suggest that osc should free ALL result resources, and I'm pretty surprised (shocked) it does not. As more and more people utilize shared hosting combined with things like osc, and as those hosting providers fill up, this error will become more and more pronounced.

 

My feature request is that each and every result resource be released precisely when it is no longer needed. This will become even more urgent when the database layer is made abstract (i.e., not mysql bound).

 

joy

 

 

you should read the above text a little more carefully.

Treasurer MFC

Posted
you should read the above text a little more carefully.

 

Thanks. I'll brush off my bifocals.

 

Who is not concerned with freeing server resources/memory? You? To only be concerned with releasing the memory utilized in the case of large queries is not a scaleable approach. I would respectfully suggest again that result resources be released precisely when they are no longer needed, which is almost always after the results are fed into a variable.

 

"At the end of the script" is ambiguous, at least for me, and I'm sure for others. "the script" can refer to different scopes. I could not, after a subsequent more careful reading of the above text, determine what scope you meant.

 

Also, I couldn't find where osc released resources, which was my actual question, not the usage of mysql_free_result. Since tep_db_free_result is not called a single time (as least in my osc), mysql_free_result is not either.

 

If some user has a big shop, with lots of products, on a cheap hosting provider (i.e., lots of users sharing server resources), osc might contribute to a situation on that host in which other users encounter a 1040 connection error and potentially lose biz/$ because visitors walk away from a screen with this unhandled error.

 

Furthermore, why is 1040 (and others errors?) UNHANDLED by osc??

  • 1 year later...
Posted

Respected,

 

should not the PHP machine it's self free all resources once the script exits? Does it have to be done manually for the sanity check or it's mandatory in PHP? There is the story that the machine will take care of all used memory with using destructors created on every creation of a variable, or array or similar.

 

Am I wrong? Forgive my ignorance, I am new in PHP. it's somewhat different from the C language.

 

Regards,

Katarina

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...