skip to Main Content

Recently i got mac m1
i am running a product which uses [email protected] installed through homebrew, the data from the product is connected successfully to mysql and started populating but nearing the end of population there is a connection problem with mysql and shows exception during getconnection from pool am using mac m1 and mysql5.6

the error is as follows

java.sql.SQLException: java.lang.Exception: Exception during getConnection from pool Exception occurred during get connection from datasource

This dosnt occur at product startup but during 80% of population.

config file my.cnf

# Default Homebrew MySQL server config
[mysqld]
# Only allow connections from localhost
bind-address = 127.0.0.1

2

Answers


  1. Check max_connections in the MySQL configuration file. It manages the number of simultaneous connections according to the demands of your application.

    Login or Signup to reply.
  2. A connection pool provides you with a certain (configured, maximum) number of connections to the database.

    The assumption is: When you’re done with a connection, you’re going to return it to the pool. This might be done implicitly by the garbage collector, but for a long running process, there’s no guarantee that the garbage collector ever runs during your routine.

    If your code uses the connections up like candy and never returns them (typically through connection.close()), or uses new connections for each operation rather than reusing a single connection, you’re able to quickly exhaust the connection pool. This is called "resource leaking".

    Raising the number of available connections (as suggested in the other answer) might help you right now, but will fail again, a bit later, when your routine populates the database with more data, if those routines still chew up connections.

    As you neither provide configuration details nor code, that’s as much answer as can be given.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search