Kombustor
Kombustor

Reputation: 63

Pool error Timeout waiting for idle object (Java JDBC)

I recently updated my MySQL server to MariaDB, since then I'm getting in trouble with a few errors.

After some time, my application crashes and these errors appear:

java.util.NoSuchElementException: Timeout waiting for idle object

or

Cannot get a connection, pool error Timeout waiting for idle object

Or NullPointerExceptions on executeUpdate() on a preparedStatement!

My code to connect to the database is:

public static void connect() {
    try {
        connection = DriverManager.getConnection("jdbc:mysql://"
                + Data.MySQL_host + ":3306/" + Data.MySQL_db,
                Data.MySQL_user, Data.MySQL_pass);
        System.out.println("MySQL connected!");
    } catch (SQLException e) {
        System.out.println("Error connecting to MySQL");
        e.printStackTrace();
    }
}

Do I have to modify my MariaDB Server, or is it application-related?

Upvotes: 3

Views: 1332

Answers (1)

topCoder
topCoder

Reputation: 95

something wrong wiht your configuration,so you can't get a idle Object to connect.chekout your configuration first!

Upvotes: 0

Related Questions