Solved Too many connections?

Discussion in 'Plugin Development' started by flash110, Sep 8, 2016.

Thread Status:
Not open for further replies.
  1. Offline

    flash110

    Ok, so I have been working with multithreaded programs in Java, and I have come accross a problem. Error from console - Data source rejected establishment of connection, message from server: "Too many connections." How do I fix this? @Zombie_Striker
     
  2. Offline

    Zombie_Striker

    @flash110
    Your issue comes from your MySQL. You SQL data base has a limit to the amount of requests that it cant take within a certain amount of time. The reason you are getting the error is because you are going over this limit. Make sure you don't make too many at one time. You can do this by setting an actual limit to the amount of requests that can be made (if(requests < limit)), or just simply delay the requests.
     
  3. Offline

    mythbusterma

    @Zombie_Striker
    @flash110

    Much more likely that he never bothers to close all the connections he opens, if I had to take a guess. Also, it being multithreaded has nothing to do with this.

    Stop opening new connections without closing them.
     
  4. Offline

    flash110

    Ok, I figured out the issue, and that can be solved with using the right tool for the right job.
    I will be making a new thread shortly that highlights the actual issue better. For now I am going to mark this as solved.
     
Thread Status:
Not open for further replies.

Share This Page