close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

mysql_pconnect() too many simultanous connection issue

Thread began 10/19/2015 1:59 pm by mohammed.wajiro | Last modified 9/12/2017 3:31 pm by Ray Borduin | 786 views | 6 replies |

mohammed.wajiro

mysql_pconnect() too many simultanous connection issue

I designed a registration portal with databridge and my site keeps prompting a warning about too many connections whenever i try to connect to database. After going through a lot of forums, it was suggested that i should used mysql_connect() instead of the persistent version. What are the possible changes i could make to the codes of my pages generated by data bridge to as to be compatible with mysql_connect()?

Sign in to reply to this post

Ray BorduinWebAssist

You can just update the connection file in the Connections folder. That is the only location where the database connection is made.

Often that error occurs because of a server configuration issue. You may want to contact your hosting provider and have them look into it for you as well.

Sign in to reply to this post

mohammed.wajiro

But what i understood about the difference between the two is that, mysql_pconnect() creates a permanent connection for about 8 hrs (by default) and does not close connection with mysql_close() while mysql_connect() closes connection by calling mysql_close() function. If that is the case, changing to mysql_connect() function requires one to close the connection. Must i close the connection on every page that opens that connection?

Sign in to reply to this post

Ray BorduinWebAssist

php should automatically close the connection when the page is delivered to the browser, so unless you were closing it before the end of the page it isn't necessary to close as long as php is working correctly.

Sign in to reply to this post

mohammed.wajiro

If that is case, what is the benefit of implementing the persistence version in data bridge? When i contacted my host they suggested that i should upgrade to a dedicated host to do away with that problem. If i make changes to the connection function and that takes care of the problem automatically, i see no benefit of implementing mysql_pconnect() in your extension.

Sign in to reply to this post

Ray BorduinWebAssist

If that solves the problem then that is a valid solution. It is supposed to persist the connection and re-use the same connection for each user. pconnect should hypothetically cause fewer connections, not more. I'm not sure who your hosting provider is, but the solution is usually to make sure your php server is configured properly as to not cause the problem. However any solution that removes the error is valid.

Sign in to reply to this post

mohammed.wajiro

I was able to track and solve the problem. The problem was due to a php script that is being called by the registration page, which contains a connection to a database that was not closing each time the script executes. i.e. Whenever the script executes, the previous connection is still live. Therefore, whenever the script executes for certain number of times equals to the maximum number of connections set by the server, no more connections were accepted and the error presents.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...