none
Vb .NET and MySql connections not closed... why? RRS feed

  • Question

  • I have a big problem and I do not know how to solve it:

    In a  shared <g class="gr_ gr_19 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="19" id="19">windows</g> web hosting with a lot of <g class="gr_ gr_24 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar multiReplace" data-gr-id="24" id="24">asp</g> and <g class="gr_ gr_23 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="23" id="23">aspx</g> pages accessing MySql (both VB .NET, both VBScript) and I cannot find where I do not close the connection to the database.

    This causes a lot of simultaneous phantoms connections that, reaching the connections limit imposed by the server, block my access to the database. :(

    What can I do to find the badly written code? Thanks to all will reply to me.


    Friday, March 2, 2018 9:46 AM

All replies

  • First off please clean up your post as it's nearly impossible to read. What I could read is you have a single or have multiple connections in a app. This is very unwise, you need to create the connection when needed, use it, close it. 

    What you need to do is rethink how you are doing connections.


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Friday, March 2, 2018 10:08 AM
  • What can I do to find the badly written code? Thanks to all will reply to me.

    Why don't you try showing some of the code that is doing database access?  As Karen mentioned, clean up your post so it can be read, use another browser to make the post and use the code formatter to post the code, which is an icon next to the HTML icon on the tool bar.

    Friday, March 2, 2018 10:14 AM
  • I have a big problem and I do not know how to solve it:

    In a  shared windows web hosting with a lot of asp and aspx pages accessing MySql (both VB .NET, both VBScript) and I cannot find where I do not close the connection to the database.

    This causes a lot of simultaneous phantoms connections that, reaching the connections limit imposed by the server, block my access to the database. :(

    What can I do to find the badly written code? Thanks to all will reply to me.


    No way to tell without seeing code. Plus this is a web application environment which could impact how connections are being pooled. You may want to post to the below forum as well:

    https://forums.asp.net/85.aspx/1?Oracle+MySQL+Sybase+Informix+and+other+databases


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Friday, March 2, 2018 2:11 PM
  • You'll definitely want to ask this in the asp.net forums.  Your data access must be setup to work with the page flow process of a web application.  Its likely the culprit is in your legacy asp code, but it will be worth reviewing the configuration in ASP.Net as well.

    Reed Kimble - "When you do things right, people won't be sure you've done anything at all"

    Friday, March 2, 2018 7:21 PM